Gennadiy Rozental wrote:
2. Could type that implements swap() method somehow follow the second
case
road also? For example, could you somehow deduce T* from buffer and
swap
it
with local copy of the argument?
Yes, I can look into such optimizations. But as I noted in previous
Eric Friedman [EMAIL PROTECTED] writes:
While this is certainly quite implementable, I feel a bit uneasy about
hinging variant's exception-safety guarantees on such a small point as
whether 'void' content is allowed. I imagine it would not only make variant
more confusing to use but also may
Gennadiy Rozental wrote:
overview.) This technique is necessary to provide a general
guarantee
of strong exception-safety, which in turn is necessary to maintain
a never empty invariant for variant.
What is this invariant? And why is it that important.
The invariant is quite
2. Could type that implements swap() method somehow follow the second
case
road also? For example, could you somehow deduce T* from buffer and swap
it
with local copy of the argument?
Yes, I can look into such optimizations. But as I noted in previous
messages, if I can prevent
overview.) This technique is necessary to provide a general guarantee
of strong exception-safety, which in turn is necessary to maintain
a never empty invariant for variant.
What is this invariant? And why is it that important.
The invariant is quite straightforward: any object of
Gennadiy Rozental wrote:
7. Variant size
Unfortunately I was not able to follow exact logic behind usage of 2
different storages. But one thing I know:
sizeof(boost::variantint,std::string) could not be 28.
From what I view it seems that types that are used to construct
storage2
Eric Friedman wrote:
1) In addition to its role in enabling recursive variants,
boost::incompleteT provides a convenient way to increase space
efficiency
(though at the expense of speed efficiency due to heap allocation). Note
though that this is only because incomplete wraps a T*, which is