|
Boost : |
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2006-04-10 18:51:45
Reece Dunn wrote:
> Robert Ramey wrote:
>
>>On the other hand - I don't see the motivation for including concepts
>>in the core language. Haven't we been able to implement concept
>>checking with the current facilities of the library? It seems to me that
>>the main problem these days with the C++ language these days is that
>>its too hard to write a correct compiler for it. Making the core
>>language fancier will only make this problem worse.
>
>
> Concepts in the language allow things that aren't currently possible with
> C++98. For example, standard algorithms of the form:
>
> fn( Iterator first, Iterator last )
> fn( Iterator first, Iterator last, Functor f )
>
> 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.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk