Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] for_each with indices
From: Christopher Schmidt (christopher_at_[hidden])
Date: 2012-07-30 21:23:43


Agustín K-ballo Bergé <kaballo86_at_[hidden]> writes:
> However, I would like to get the index as a compile time value. What
> would be the simpler/best way to do this? Creating an iterator adaptor
> that keeps track of advances to the base iterator (should I be using
> the iterator_facade extension mechanism)? Or perhaps zipping the
> sequence with some kind of infinite mpl::vector_c sequence?

I would use fusion::fold with the index stored as state via a
mpl::int_.

        Christopher


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net