Boost logo

Boost Users :

From: Alban Linard (alban.linard_at_[hidden])
Date: 2008-02-26 06:32:45


i am trying to build a recursive variant containing another variant, as
described in the following source code:

#include <cstdlib>
#include <vector>
#include <string>
#include <boost/variant.hpp>

typedef ::boost::variant
         < int
         , bool

typedef ::boost::make_recursive_variant
         < first_variant
         , ::std::string
         , ::std::vector< ::boost::recursive_variant_ >

int main()
   first_variant f(true);
   second_variant s(f);
   return EXIT_SUCCESS;

It does not compile (g++-4.0 and g++-4.3). It seems that the
"first_variant" part of second_variant is not used.
Why this behavior ? Is there a workaround ?

Alban Linard

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at