I have the following problem:
template <int N, typename T> nviewgetter( T const& t ) { typename T::const_iterator it(t.begin()); typedef BOOST_TYPEOF_TPL(*it) etype; typedef typename boost::fusion::result_of::as_nview<etype, N>::type netype; std::vector<netype> r; while(it!=t.end()){ r.push_back( boost::fusion::as_nview<N>(*it) ); it++; }
T is expected to be a Forward Sequences sequence (for example, boost :: fusion :: vector), and I want to get an idea of ββthe Nth element in each element of T. However, I donβt know the type of boost::fusion::vector
, for example . boost::fusion::vector<int, double>
or boost::fusion::vector<int, double, std::string>
. In the code, I can determine the correct type, but I cannot figure it out in the function declaration.
Thanks!
Any suggestions for improving the code are also welcome. :)
user677656
source share