Home » U++ Library support » U++ Core » Interesting struggle with "Moveable<T>" usage in GCC
Re: Interesting struggle with "Moveable<T>" usage in GCC [message #16946 is a reply to message #16855] |
Tue, 22 July 2008 15:36   |
mr_ped
Messages: 826 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
I was not aware of the aggregate/class flavors, that was the missing piece for me. (it's funny I use C/C++ for quite some years, but I never really bothered to study the language itself extensively to a point how well I did study ASM or Pascal, I just learn new things as I hit them during programming)
I would expect this behavior with virtual functions, as then you have to init vtab pointer for every instance, but the constructor and inheritance took me by surprise.
And yes, I would love a bit more intelligent and forgiving compiler, as from ASM point of view there's no true different between struct with 2 ints, and same struct with constructor, I will keep wishing. 
Thank you for explanation, and about the deepcopy, yes, my real source is more complex, with some "typedef Vector<almost_struct_class> TmyVector;" probably being the culprit.
This was just a bare minimum source to show how Moveable prevents you from braces initialization. None of these are big problems, they just clutter my sources a bit more than it would be necessary in ideal world, so I had to ask...
Edit:
And another syntax sugar which would make my sources look better would be direct initialization of Vector container. I think with some clever C++ operator overloading this may be eventually possible, or something which would be quite close, but I don't have time+will to look into it, and heavy usage of operators makes me always to shiver a bit, as you have to never forget about them when you read the source.
[Updated on: Tue, 22 July 2008 15:40] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Aug 15 03:08:04 CEST 2025
Total time taken to generate the page: 0.12200 seconds
|