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 #38134 is a reply to message #38131] Sun, 02 December 2012 16:04 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Lance wrote on Sun, 02 December 2012 15:08

I think eventually U++ should get rid of pick_ and make use of rvalue reference instead. rvalue reference solves the same problem pick_ saught to solve and is standard compliant, and behaves more consistent across compilers: I believe pick_ is #define'd to different things on MSVC from on g++, and to avoid conflicts, U++ has to introduce a dummy parameter for deep copy semantics.

Hi Lance,

If I understand both picking and rvalue references correctly, there is still a very valid reason to keep using picking: Rvalue references work ONLY on temporary objects. In U++, you can use picking on any object and even reuse it, assuming you clean it up after it has been picked, typically by calling Clear() or by assigning content from another object. I think this can not be done simply with rvalues.

Also, I believe that introduction of move semantics to C++11 standard will actually make it easier to explain U++ pick to new programmers, because they will already be familiar with the concept. We should just adapt the introductory documentation to explain how pick constructor is similar to move constructor, what is different and how U++ further extends this concept.

Honza

EDIT: After bit more reading, I found you can actually make it work with any object, using std::move... Right now, that seems downright ugly and hackish to me Smile I guess I need to read even more before I can make my mind whether the switch to move semantics is a good or bad idea.

[Updated on: Sun, 02 December 2012 16:13]

Report message to a moderator

 
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 10:23:05 CEST 2024

Total time taken to generate the page: 0.01865 seconds