Boost logo

Boost :

Subject: Re: [boost] Range begin/end and Fusion begin/end
From: Jeffrey Hellrung (jhellrung_at_[hidden])
Date: 2010-03-18 13:49:33


Mathias Gaunard wrote:
> In C++0x, begin and end are supposed to be found through ADL, and this
> might end up considering fusion::begin/fusion::end as possible overloads.
>
> Unfortunately, this breaks, as fusion::begin and fusion::end produce
> hard errors when passed something else than a fusion sequence.
>
> All in all, I find ADL very dangerous. Should it be advocated not to use
> the names "begin" and "end" for something else than ranges to avoid issues?
> I suppose that for Fusion, it could be possible to use SFINAE to mask
> the overloads if the arguments aren't fusion sequences.

Hmmm...that's unfortunate that C++0x decided to "usurp" use of
begin/end, seeing as how it's established practice (isn't it?) that
those functions could be meaningful outside the context of ranges.
Seems to me that Boost.Range's lookup via ADL of range_begin and
range_end makes more sense...

- Jeff


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