First I was going to suggest you to use mpl::front to retrieve the first element of the type sequence, but the new variant doc does not state that the first element of the type sequence will be created in the variant's memory. I remember to read that it was once the case.

You can try this: (But I am not sure if it works or is portable)

typedef typename mpl::transform<
          recursive_enabled_types
        , unwrap_recursive<mpl::_1>
        >::type types;

typedef boost::mpl::front<types>::type    first_type;
 
MyVariantType v;
first_type *value = get<first_type>(&v);
 
Regards,
Ovanes

On Tue, May 6, 2008 at 5:33 PM, Igor R. <igor_rubinov@hotmail.com> wrote:
Hi Ovanes,
 
Yes, I know, but that's not what need.
 
 

Date: Tue, 6 May 2008 17:25:08 +0200
From: om_boost@keywallet.com
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] [variant] how to get 1st bounded type


You can apply the visitor to the variant and receive the instance of the stored type.


With Kind Regards,
Ovanes