Boost logo

Boost Users :

Subject: [Boost-users] [Fusion] Flatten a sequence of sequences
From: Clinton Mead (clintonmead_at_[hidden])
Date: 2010-12-07 03:38:39


Hi All

Lets say I have something like the following:

make_vector(1, make_vector('b', 3, make_vector(4, 5.5), "six"), 7, 8)

I want to produce an function f such that

f(make_vector(1, make_vector('b', 3, make_vector(4, 5.5), "six"), 7, 8)) ->
[1,'b',3,4,5.5,"six",7,8]

i.e. a flattened version of the sequence.

I don't mind if this is a view of the original sequence or an actual vector.

I don't mind a solution in C++0x if it can compile on GCC 4.5.1.

Thanks



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