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
AMDG Stefan Strasser wrote:
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
::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 I need to find the type vector , 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.
you'll need something like this:
typename fusion::result_of::as_vector<
typename fusion::result_of::push_back
::type
In Christ, Steven Watanabe
participants (2)
-
Stefan Strasser
-
Steven Watanabe