On Wed, Mar 10, 2010 at 01:46:30PM -0800, Steven Watanabe wrote:
Can you give an example of the kind of recursive variant and the sequence(s) that you want to get out of it?
Let this be the variant type typedef boost::make_recursive_variant< int, double, std::vectorboost::recursive_variant_ >::type variant; and this an instance of it std::vector<variant> vec; vec.push_back(42); vec.push_back(4.2); vec.push_back(vec); variant v = vec;
In particular how are the runtime values of the elements of the sequence to be determined?
Conceptually, I am thinking of a visitor that goes over the variant and
flattens it. In the above example, the corresponding sequence would be
[42, 4.2, 42, 4.2]
which corresponds to a fusion::vector
Depending on what you're doing, you might be able to use the nested types typedef of variant, which is an MPL sequence.
Are you referring to the variant<T>::types MPL sequence? Matthias -- Matthias Vallentin vallentin@icsi.berkeley.edu http://www.icir.org/matthias