Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-05-02 11:31:45


Andy Little wrote:
>
> "Eric Niebler" <eric_at_[hidden]> wrote
>
>> What about nested invocations for BOOST_FOREACH:
>>
>> int a[100][200];
>> int sum = 0;
>>
>> BOOST_FOREACH(int (&x)[200], a)
>> BOOST_FOREACH(int i, x)
>> sum += i;
>>
>> ?
>
>
> Its a fair point but just as possible the other way:
>
> FOR_EACH(a){
> BOOST_AUTO(& x, *_); // or int (&x)[200] = *_;
> FOR_EACH(x)
> sum += *_;
> }
>

Andy, I think you are arguing for a design which is untenable. I would
not accept a dependency on BOOST_AUTO, and I would not require users to
register types and iterators with Boost.Typeof in order to use
BOOST_FOREACH. You're trying to make BOOST_FOREACH easier to use, and I
appreciate that, but an anology about babies and bathwater seems
appropriate here.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk