Hi all,
[added this line to make gmane happy.]
I'm looking for a way to remove "empty" values from a tuple. In other words, say
I have a tuple T:
tuple T;
// where E can be either null_type, or mpl::void_, etc.
I'd like for it to collapse into:
tuple T2;
Now, the reason I say "values" is because I found a way to do just that, but
only for the types, which you'll find below. However, I can't figure out how to
then *construct* the collapsed tuple given the original tuple (and its values.)
Specifically, it's the `???' below that I'm missing.
Thanks!
// Collapse code:
template <typename Sequence>
struct tuple_from_sequence :
mpl::reverse_fold
< Sequence
, tuples::null_type
, tuples::cons
> {};
template
struct collapse > {
typedef tuple original;
typedef mpl::list sequence;
typedef typename mpl::remove::type removed;
typedef typename tuple_from_sequence<removed>::type type;
static type construct(original const& t) {
// return ???;
}
};