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 » Interesting struggle with "Moveable<T>" usage in GCC
Re: Interesting struggle with "Moveable<T>" usage in GCC [message #17133 is a reply to message #16855] Wed, 30 July 2008 12:14 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Another funny thing, if you mess up the optional deep copy functions ( namely DeepCopyConstruct to call the implicit copy constructor instead of your T( T, int ) deep copy constructor ) for your class defined to be moveable trough that NTL_MOVEABLE macro:
you can end with Vector source which works with MSC8 (the implicit copy constructor is not called at all), but does break under GCC. (with the wrong pick behavior assert)

I can't provide example because the source is too complex and basically it was my bug in DeepCopyConstruct, so it's not problem of UPP.

It just made me to scratch my head a bit, that two compilers do use quite different way to construct the final Vector related code for my class, MSC avoiding my bugged functions completely.

Of course using "class A : MoveableAndDeepCopyOption<A> {};" fixed that and made my code cleaner (and right now I didn't use direct initialization for that A class anymore), so if you are new to UPP+pick behavior (like me), try to avoid making things by hand, and use rather those Moveable<> and similar things whenever possible, it makes code clean and easy to read, and will prevent you from doing silly mistakes (which may go undetected with one compiler and show just later on another one).
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using Vector::At doesn't initialize implicit types
Next Topic: DEFAULT_MAX_CONTENT_SIZE or max_content_size
Goto Forum:
  


Current Time: Wed Jun 12 01:47:13 CEST 2024

Total time taken to generate the page: 0.02075 seconds