Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-09 13:03:30


--- Brock Peabody <brock.peabody_at_[hidden]> wrote:
[...]
> It's not just about what happens to your variant, it's about what happens to
> the whole program. With the basic guarantee you are free to ignore the
> variant if you want and do something else. You can try to assign a
> different type. You can write a log entry. Without the basic guarantee,
> you can't do _anything_!
>
> Imagine, for instance, that boost::variant ignored exceptions during
> assignment - it stops making the basic guarantee. Can you see that the
> destructor for boost::variant will enter undefined territory?
>

I think there is a missunderstanding.
I am not saying about ignoring anything or letting the
program to go to an undefined state.
All I am trying to say that the basic guarantees
the way they are defined in boost::variant are
not practically usefull.
The variant guarantees say that variant
is allowed (during an exception) to change
the the current user data to a value-intialized data.

I don't see anything usefull in that.

I am arguing that in case of an exception
variant should delete the contained object
and set it's state to singular.
It is more friendly to the rest of the program
than changing the user data.

In fact it is no defferent from basic
guarantess if you think of variant as
always containing a built-in type.

Eugene

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk