Boost logo

Boost Users :

From: Igor R. (igor_rubinov_at_[hidden])
Date: 2008-05-07 04:37:39


Hi Ovanes,

> Igor, I assume the following:> If the first type throws an exception while creation the second is created and so forth and the exception is probably not reported to you.
 
No, as Steven aready wrote, that's not what happens.
 
> Why don't you like visitor to dispatch the type stored in the variant?
 
I like it very much, and I use variant because of the power of the static visiting mechanism.
The reason I wanted to test if the variant contains its 1st type is the following: my variant is made of a list of shared-pointers to various types; there's a routine that initializes it with one of the types depending on some conditions, then it applies some visitor on the resulting variant and stores it then in a container - however, there's no "default" behavior, so if neither condition was met, the variant remains "uninitialized" - i.e. it contains 1st type "zero" ptr. I want neither apply the visitor on "empty" smartpointer nor store it in the container, so I have to know whether it was "really" created or not. Two simple ways I can think about are to test the resulting variant or to introduce some flag - of course, both ways are far from ideal...
_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net