Boost logo

Boost Users :

Subject: [Boost-users] [fusion] "real" return types
From: Stefan Strasser (strasser_at_[hidden])
Date: 2009-08-19 20:06:56


I have a problem with boost.fusion I can't figure out from the documentation.

consider the following example:

template<class Vector>
? function(Vector vec){
        return fusion::push_back(vec,123);
}

what is the return type ?
the return type is supposed to be a random access sequence, so
result_of::push_back<Vector,int>::type is not an option, because push_back
only returns a forward sequence.
so I have to construct a new vector from the view that push_back returns.
if Vector was vector<char,short> I need to find the type
vector<char,short,int>, preferrably without an own MPL algorithm since this
is only a simple test case, the real return type is much more complex and
based on more than one transformation function.

thank you


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