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   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Sun, 28 January 2018 16:47I 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
|
|
|
 |
|
Vector<T>::Set(int i, T&& x) proposal
By: Novo on Tue, 19 December 2017 23:30
|
 |
|
Re: Vector<T>::Set(int i, T&& x) proposal
By: mirek on Sun, 28 January 2018 22:47
|
 |
|
Re: Vector<T>::Set(int i, T&& x) proposal
By: Novo on Tue, 30 January 2018 03:30
|
 |
|
Re: Vector<T>::Set(int i, T&& x) proposal
By: mirek on Wed, 31 January 2018 19:34
|
 |
|
Re: Vector<T>::Set(int i, T&& x) proposal
By: Novo on Wed, 31 January 2018 20:01
|
 |
|
Re: Vector<T>::Set(int i, T&& x) proposal
By: mirek on Thu, 01 February 2018 18:53
|
 |
|
Re: Vector<T>::Set(int i, T&& x) proposal
By: Novo on Thu, 01 February 2018 19:03
|
Goto Forum:
Current Time: Sat Apr 26 05:56:44 CEST 2025
Total time taken to generate the page: 0.01947 seconds
|