Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost users][tuple] foreach with tuple
From: pete_at_[hidden]
Date: 2009-08-04 04:17:08


On Tue 04/08/09 09:02 , Matthieu Brucher <matthieu.brucher_at_[hidden]> wrote:

>Hi,
>
>Try with:
>foreach ((boost::tuple<int,int>& i_pair), l_listLeftLines)
>
>The issue is that < and > are not delimiters for the macro, so you
>have actually 3 parameters if you don't add the parenthesis.

>From memory the extra parentheses solution isn't good enough either.
You have to go with one of the workarounds described in the "pitfalls" section of the documentation:

http://www.boost.org/doc/libs/1_39_0/doc/html/foreach/pitfalls.html

Pete


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