Boost logo

Boost :

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...


-----Original Message-----
From: boost-bounces_at_[hidden]
[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 and I
have uploaded the source to the vault ( ). Is there any

Christopher Diggins

Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at