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 » NEW: generic Toupel grouper
Re: NEW: generic Toupel grouper [message #29287 is a reply to message #29284] Thu, 14 October 2010 02:14 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi,

As I promised, here is the code I mentioned in my previous post...

Disclaimer: I am aware that the implementation is verbose, bulky, tricky, possibly deceiving and abuses compiler to do things it was never meant to do. Yet I am very happy to see the result - simple template that is able to determine moveability of it's parameters.

Majority of the ugly code is in Topt.h. Since U++ uses two different way how to mark a type moveable (Moveable<> and NTL_MOVEABLE), the code has two ugly parts, one checking each method and ORing both together. Also I had to add some more code to NTL_MOVEABLE macro to be able to determine the moveability correctly. In the Tuple.h, the only change is the PossiblyMoveable<> base for each size of Tuple.

PossiblyMoveable might be useful in some other context too. I just can't think of any right now. Also IsMoveable<T> and IsBase<Base,Derived> (can determine if Base is really base class of Derived) could be helpful for someone, but they would need to be little more general for common user to use...

Tell me what you think about this, but don't tell me I'm crazy Twisted Evil I'm actually quite realistic and don't expect this to get into U++. I wrote it mainly for fun of discovering new tricks and pushing the limits Wink

Best regards,
Honza
  • Attachment: Topt.h
    (Size: 19.66KB, Downloaded 205 times)
  • Attachment: Tuple.h
    (Size: 3.19KB, Downloaded 310 times)
 
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
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
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: Date limited to 2020 and 2015 does not work ?!?
Next Topic: Value question (memory consumption)
Goto Forum:
  


Current Time: Sun Apr 27 14:29:29 CEST 2025

Total time taken to generate the page: 0.00765 seconds