I am using Boost.MPL, I have a compile-time list (boost::mpl::list).
When I push back an element, I get something that is probably equivalent to a list but is not an boost::mpl::list.
#include <boost/mpl/list.hpp>
int main(){
using l = boost::mpl::push_front<boost::mpl::list<int, double, std::string>, char>::type;
}
l is boost::mpl::l_item<mpl_::long_<4>, char, boost::mpl::list3<int, double, std::__cxx11::basic_string<char> > >
How can I transfrom l into a proper boost::mpl::list<char, int, double, std::string>?
In Boost.Fusion we have boost::fusion:as_list, but I cannot find the equivalent function in Boost.MPL.
You can achieve that with a custom type by implementing a
push_backMPL operator for it.If you just need to instantiate an
std::tuplewith types of MPL sequence:Or even simpler: