
5 Aug
2008
5 Aug
'08
1:08 a.m.
AMDG Emil Dotchevski wrote:
On Mon, Aug 4, 2008 at 4:35 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
It does call operator= when both operands have the same type. Thanks.
Is it then true that even foo::operator= throws, in the code below:
variant<foo,int> a=foo(....); variant<foo,int> b=foo(....); a=b;
we will never end up with an int in a? correct. If that's the case, then maybe I missed something in the documentation.
This behavior is stated here: http://www.boost.org/doc/libs/1_35_0/doc/html/boost/variant.html#id978547-bb The discussion here http://www.boost.org/doc/libs/1_35_0/doc/html/variant/design.html#variant.de... distinguishes between same-type and different-type assignments, too. In Christ, Steven Watanabe