Created on 2009-03-11.00:00:00 last changed 171 months ago
Proposed resolution:
(no changes to <functional> synopsis required)
Change synopsis in Class template function [func.wrap.func]:
template<Returnable R, CopyConstructible... ArgTypes> class function<R(ArgTypes...)> : public unary_function<T1, R> //iff sizeof...(ArgTypes) == 1 andsee below// ArgTypes contains T1: public binary_function<T1, T2, R> //iff sizeof...(ArgTypes) == 2 andsee below// ArgTypes contains T1 and T2{ ...
Add new p1/p2 before [func.wrap.func.con]:
The template instantiation function<R(T1)> shall be publicly and unambiguously derived from std::unary_function<T1,R> if and only if the template type parameter is a function type taking one argument of type T1 and returning R.
The template instantiation function<R(T1,T2)> shall be publicly and unambiguously derived from std::binary_function<T1,T2,R> if and only if the template type parameter is a function type taking two arguments of type T1 and T2 and returning R.
explicit function();
[ Batavia (2009-05): ]
We agree with the proposed wording. Move to NAD Editorial.
[ 2009-05-09 Alisdair adds: ]
Phrasing should be "publicly and unambiguously derived from" and probably back in reference_wrapper too. Updated wording supplied.
[ Summit: ]
Agree. std::reference_wrapper has the same structure, and we suggest that std::function be presented in the same way as std::reference_wrapper.
Addresses DE 22 [CD1]
Related to issue 1114.
The conditions for deriving from std::unary_function and std::binary_function are unclear: The condition would also be satisfied if ArgTypes were std::vector<T1>, because it (arguably) "contains" T1.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg362 |
2010-10-21 18:28:33 | admin | set | messages: + msg361 |
2010-10-21 18:28:33 | admin | set | messages: + msg360 |
2010-10-21 18:28:33 | admin | set | messages: + msg359 |
2009-03-11 00:00:00 | admin | create |