Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-04-11 05:30:52


Thorsten Ottosen <thorsten.ottosen_at_[hidden]> writes:

>> cannot have overloads (in C++98) taking containers/ranges:
>>
>> fn( Iterator first, Iterator last )
>> fn( Iterator first, Iterator last, Functor f )
>> fn( Range rng )
>> fn( Range rng, Functor f )
>>
>> as the last overload is ambiguous. Concepts will allow this to be resolved
>> as a Functor will not match the Iterator requirements :).
>
> you can use enable_if on the latter and disable it the two types are the
> same.

Not if you happen to have a type that is both a valid range and a
valid function object.

Yes, that's a corner case, but it's the corner of a large floating
block of ice.

-- 
Dave Abrahams
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