[boost] Re: Variant Library: variant size and strong guaranty

2003-04-05 Thread Eric Friedman
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

Re: [boost] Re: Variant Library: variant size and strong guaranty

2003-04-04 Thread David Abrahams
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

[boost] Re: Variant Library: variant size and strong guaranty

2003-04-04 Thread Eric Friedman
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

[boost] Re: Variant Library: variant size and strong guaranty

2003-04-04 Thread Gennadiy Rozental
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

[boost] Re: Variant Library: variant size and strong guaranty

2003-04-03 Thread Gennadiy Rozental
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

[boost] Re: Variant Library: variant size and strong guaranty

2003-04-02 Thread Eric Friedman
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

[boost] Re: Variant Library: variant size and strong guaranty

2003-04-02 Thread Eric Friedman
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