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:

live on coliru

#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

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -