c++ - How to convert a homogeneous fusion::vector to an (std/boost)::array -
i relatively new boost, believe easy problem:
given, fusion::vector<int, int, int>, need way turn array<int, 3>.
you can use builtin adaption of array<> (std or boost) , copy:
#include <boost/fusion/include/copy.hpp> #include <boost/fusion/include/vector.hpp> #include <boost/fusion/adapted/boost_array.hpp> #include <boost/array.hpp> using namespace boost; int main() { fusion::vector<int, int, int> fv(1,2,3); array<int, 3> arr; fusion::copy(fv, arr); }
Comments
Post a Comment