Boost logo

Boost Users :

Subject: Re: [Boost-users] foreach question
From: Pete Bartlett (pete_at_[hidden])
Date: 2010-10-15 15:35:24


>The following loop iterates over strings in result (which
>comes from boost::split). Is there a way to include the integer
>enumerator 'col' into the FOREACH loop?
>
>In python that would be spelled
>for col,s in enumerate (result):
> ...
>
> int col = 0;
> BOOST_FOREACH (std::string s, result) {
> H(row, col) = boost::lexical_cast<int> (s);
> ++col;
> }

See this thread http://thread.gmane.org/gmane.comp.lib.boost.user/54162
And the resulting Trac ticket: https://svn.boost.org/trac/boost/ticket/3469

for a essentially negative answer.


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