Boost logo

Boost :

Subject: Re: [boost] [poly_collection] Request for comments: fast polymorphic collections
From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2016-11-06 15:15:19

El 06/11/2016 a las 15:46, Vinnie Falco escribió:
> One question, how do you iterate over all the objects of a particular
> type in a container using a range-for? I see begin() and end()
> overloads which take a std::type index but if I want to visit all the
> "warrior" objects (from your example) in a given container `c`, what
> expression do I put in place of R below:
> for(auto& sprite : R)
> {
> ...
> }

In its current state the lib does not provide syntax sugar for this. The
alternatives are

   ... // work with *first

std::for_each(c.begin<warrior>(),c.end<warrior>(),[](auto& sprite){


This is not to say that this particular feature couldn't be in principle
added to the

Joaquín M López Muñoz

Boost list run by bdawes at, gregod at, cpdaniel at, john at