I typedef a vector with two elements. Then I push_back into it an other element and expect what result type is also a vector. But that’s not so.
Example:
typedef boost::fusion::vector<int, double> vec1;
typedef boost::fusion::result_of::push_back<vec1, std::string> vec2;
//boost::is_same<vec2, boost::fusion::vector<int, double, std::string>>::value == false
http://liveworkspace.org/code/361492801eebe24cc5679a1e899a5240
What am I doing wrong?
Regards.
You’ve aliased the
push_backitself asvec2. You need to useBut keep in mind that the type might still not be the same, Fusion algorithms are not required to preserve the type (and since
push_backfunction is supposed to return a lazy view, thenvec2will most likely be some view type). The only guarantee is thatvec2will be “A model of Forward Sequence.”.