[PATCH] c++0x variadic min, max and minmax.

Doug Gregor dgregor@osl.iu.edu
Fri Jul 11 16:13:00 GMT 2008


On Jul 11, 2008, at 11:48 AM, Chris Fairles wrote:
> N2696 ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2696.pdf
> ) in section 25.7.3 there are notes that they currently cannot specify
> requirements in concept syntax for the variadic min/max with custom
> comparer so I'm not sure if the implementations will be any easier
> with concepts given the current specification. Then again, I can't see
> the committee leaving the custom-compare versions unconstrained or use
> template meta-programming for those overloads and concept requirements
> for the others.

We'll see :)

Most likely, our (= the concepts group's) recommendation will be to  
remove the version that can't be specified with concepts. I don't know  
which way the LWG will go.

>
> The min/max versions w/o custom comparer seems like it will be trivial
> to implement
>
> template<LessThanComparable T, LessThanComparable... Args>
>  requires SameType<T, Args>...
> const T& min(const T& t, const T&... args) ... etc.
>
> No need for std::is_same variadic or not. (I tried in conceptgcc with
> no luck, I dont think variadic concepts are supported).

No, variadic concepts aren't supported yet in ConceptGCC.

	- Doug



More information about the Libstdc++ mailing list