From: Eyal Farago (eyal.farago_at_[hidden])
Date: 2005-08-09 02:22:14
I read the code project article and I have few comments:
1. why optimize only for types smaller than void*? you can specify a different max size (bigger than sizeof(void*) and probably a product of it with another integer) to achieve even better results.
2. the implementation is pretty messy and quite dangerous, I'm quite sure it wouldn't compile/work on multimple platforms, and the first one that pops into my mind is solaris which enforce proper alighnment...
3. it is possible to borrow some of the tricks boost::variant uses to achieve correct allignment. i.e. using a boost::variant<void*, char[/*buffer size here*/]> and when the buffer is used store the actual alignment in a member variable of the class.
4. if 3 isn't possible, look at boost::function implementation, but I'm not sure if they're using a buffer or a simple union with a void* and few other types...
[mailto:boost-bounces_at_[hidden]]On Behalf Of christopher diggins
Sent: Tuesday, August 09, 2005 12:49 AM
To: Boost mailing list
Subject: [boost] Improved boost::any
I have developed a type very similar to boost::any which requires less
memory and significantly reduces the number of allocations / deallocations.
If anyone is interested I have posted a brief article about it at
CodeProject http://www.codeproject.com/useritems/dynamic_typing.asp and I
have uploaded the source to the vault (
http://boost-sandbox.sourceforge.net/vault/index.php ). Is there any
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk