Iterating over Boost fusion::vector

前端 未结 4 1630
萌比男神i
萌比男神i 2021-01-16 05:33

I\'m trying to iterate over a boost::fusion vector using:

typedef typename fusion::result_of::begin::type t_iter;
  std::cout << distance(begi         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-16 06:01

    next doesn't actually advance the iterator, it just returns the next one.

    This can be seen in the docs, as the function next takes a constant argument, meaning it can't possibly actually modify the iterator:

    template<
        typename I
        >
    typename result_of::next::type next(I const& i);
                                             ^^^^^
    

提交回复
热议问题