Hmm... how could I miss such a straightforward solution?? :)
Thank you!

> Date: Wed, 7 May 2008 22:18:11 -0400
> From: nat@lindenlab.com
> To: boost-users@lists.boost.org
> Subject: Re: [Boost-users] [variant] how to get 1st bounded type
>
> Igor R. wrote:
>
> > 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.
>
> Um, wrap the variant in boost::optional?
> _______________________________________________
> Boost-users mailing list
> Boost-users@lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users



Discover the new Windows Vista Learn more!