Boost logo

Boost Users :

Subject: [Boost-users] [boost-users][Variant] Sequence instantiation
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-08-25 19:47:10


I have a sequence of types defined with the Loki library. I believe the
equivalent would be boost::mpl::vector. The sequence is used to cause
compile time asserts for unsupported types being passed to template
functions. Boost variant can be created with a given list of types.

typedef boost::variant< int, std::string, short, long > type_list;
| <boost/variant.html>|
Is it possible to create a variant from a sequence by either passing the
sequence or iterating through each value in the sequence? This would
reduce the code duplication of having one sequence for assert checking
and the other for variants.

Ryan


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