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 » Community » Coffee corner » C++11
Re: C++11 [message #38171 is a reply to message #38150] Mon, 03 December 2012 11:04 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Lance wrote on Sun, 02 December 2012 15:00


A class not written with pick_ in mind will(or may?) not work correctly with Upp::Vector<>, even if it meets all the interface requirements superficially.



Actually, that is not true. pick_ is in no way related with generic requirement of Vector elements (only 2-3 methods require it).

Please note that pick semantics and Moveable are two very different things.

pick indeed is a variant of rvalue and it might have sense to replace it with r-value. Unfortunately, rvalue lacks composition rules, which means that it has to be reimplemented for any composite type, while pick generates compiler generated composite pick operations without problems. How much more code it would mean in practice is something that I plan to test is some branch in future. But e.g. for something like RichTxt::Para, it will be nasty.

Anyway, pick is not used for performance reasons in Vector. Moveable is. And that is still a bit ahead than pick/&&.

Pick is rather interface issue, allows you to pass objects from place to place without copying them (which do not even has to be available).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: live session Prague 8.3.2013
Next Topic: Have Visual Studio? Looking for prebuilt SDL 2.0
Goto Forum:
  


Current Time: Mon Apr 29 14:30:28 CEST 2024

Total time taken to generate the page: 0.03737 seconds