Boost logo

Boost Users :

Subject: [Boost-users] [boost::mpl][boost::variant] can't get to compile this example
From: Naveen Santhanam (naveen_at_[hidden])
Date: 2009-02-24 17:37:26


Hello,

 

I am trying to create a boost::variant from a joint_view sequence of two
mpl sequences.

Can someone tell me what's wrong in the following example. I can't get
this to compile using MSVC 2005.

 

 

Thanks,

Naveen

 

 

 

#include <iostream>

#include <string>

#include <boost/mpl/vector.hpp>

#include <boost/mpl/joint_view.hpp>

#include <boost/mpl/transform.hpp>

#include <boost/variant.hpp>

 

using namespace boost;

 

typedef boost::mpl::vector<int, std::string> t1;

typedef boost::mpl::vector<double, char> t2;

typedef boost::mpl::joint_view< t1, t2 > mixed;

typedef boost::make_variant_over< mixed >::type myTypeTest;

 

void main()

{

      try

      {

            myTypeTest t("name");

      }

      catch( std::exception& e)

      {

            std::cerr << "Exception caught : " << e.what();

      }

}



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