Home » Community » Coffee corner » C++11
Re: C++11 [message #38134 is a reply to message #38131] |
Sun, 02 December 2012 16:04 |
|
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 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
|
|
|
|
|
C++11
|
|
|
Re: C++11
By: mirek on Fri, 14 October 2011 12:18
|
|
|
Re: C++11
By: lectus on Sat, 03 December 2011 12:03
|
|
|
Re: C++11
|
|
|
Re: C++11
By: Lance on Sun, 02 December 2012 15:08
|
|
|
Re: C++11
|
|
|
Re: C++11
By: Lance on Sun, 02 December 2012 18:05
|
|
|
Re: C++11
By: Lance on Sun, 02 December 2012 18:47
|
|
|
Re: C++11
By: Lance on Sun, 02 December 2012 19:30
|
|
|
Re: C++11
|
|
|
Re: C++11
By: Lance on Sun, 02 December 2012 21:00
|
|
|
Re: C++11
By: mirek on Mon, 03 December 2012 11:04
|
|
|
Re: C++11
By: mirek on Mon, 03 December 2012 11:10
|
|
|
Re: C++11
By: Lance on Tue, 04 December 2012 00:55
|
|
|
Re: C++11
By: mirek on Tue, 04 December 2012 08:08
|
|
|
Re: C++11
By: Lance on Tue, 19 March 2013 03:24
|
|
|
Re: C++11
|
|
|
Re: C++11
By: mirek on Sun, 24 June 2012 12:50
|
|
|
Re: C++11
By: unodgs on Sun, 24 June 2012 13:02
|
|
|
Re: C++11
By: mirek on Sun, 24 June 2012 13:13
|
|
|
Re: C++11
By: unodgs on Sun, 24 June 2012 13:21
|
|
|
Re: C++11
|
|
|
Re: C++11
By: lectus on Wed, 27 June 2012 01:29
|
|
|
Re: C++11
By: mirek on Thu, 28 June 2012 08:16
|
|
|
Re: C++11
By: Lance on Sun, 02 December 2012 06:18
|
Goto Forum:
Current Time: Fri Nov 01 00:49:40 CET 2024
Total time taken to generate the page: 0.02056 seconds
|