Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Vector<T>::Set(int i, T&& x) proposal
Re: Vector<T>::Set(int i, T&& x) proposal [message #49345 is a reply to message #49336] Tue, 30 January 2018 03:30 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Sun, 28 January 2018 16:47
I am considering this, but single element Set was always just v.At(i) = pick(src);

Well, yes. This will work as well. But this is significantly less intuitive. Your way of solving this problem definitely didn't come to my mind when I was looking for a solution. Adding of an rvalue-based version of Set definitely won't break API because you already have a reference-based version. This is just another performance optimization.

My solution is based on move-constructor and yours is based on move-operator.


Regards,
Novo

[Updated on: Tue, 30 January 2018 03:45]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Function.h: "expression cannot be used as a function"
Next Topic: Core/SSL crashes at exit on Linux.
Goto Forum:
  


Current Time: Tue May 21 18:30:06 CEST 2024

Total time taken to generate the page: 0.01887 seconds