
On Mon, Aug 4, 2008 at 12:04 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
Emil Dotchevski wrote:
Also, I am not necessarily advocating strong exception guarantee. I would be fine if the semantics of operator= were such that it may leave the object in a particular unusual state. The problem is that as it is now, it may leave the object in a seemingly OK state.
* "Implementation Note*: So as to make the behavior of |variant| more predictable in the aftermath of an exception, the current implementation prefers to default-construct |boost::blank| if specified as a bounded type instead of other nothrow default-constructible bounded types. (If this is deemed to be a useful feature, it will become part of the specification for |variant|; otherwise, it may be obsoleted. Please provide feedback to the Boost mailing list.)"
Yes, I was aware of this workaround and of the one Mathias mentioned. However, variant<foo,bar,blank> and variant<wrapper<foo>,wrapper<bar>> aren't the same as variant<foo,bar>. I'm questioning the rationale of the current variant::operator= semantics, not necessarily looking for a way to work around them. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode