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 #49368 is a reply to message #49366] Wed, 31 January 2018 20:01 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Wed, 31 January 2018 13:34

Do you see any problem with trivial implementation

void Vector::Set(int i, T&& x) { At(i) = pick(x); }


IMHO, it should look like below.
T& Vector::Set(int i, T&& x) { return At(i) = pick(x); }

My current coding pattern (without the T&& version) looks like that:
T& v = vector.At(ind) = T(args);


Regards,
Novo
 
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: Fri May 03 23:33:44 CEST 2024

Total time taken to generate the page: 0.02713 seconds