Created on 2009-03-19.00:00:00 last changed 161 months ago
Proposed resolution:
Change the synopsis of [func.wrap.func], and remove the associated definitions in [func.wrap.func.con]:
template<Returnable R, CopyConstructible... ArgTypes> class function<R(ArgTypes...)> { ... template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes...> && Convertible<Callable<F, ArgTypes...>::result_type, R> function(F);template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes...> && Convertible<Callable<F, ArgTypes...>::result_type, R> function(F&&);... template<class F, Allocator Alloc> function(allocator_arg_t, const Alloc&, F);template<class F, Allocator Alloc> function(allocator_arg_t, const Alloc&, F&&);... template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes..> && Convertible<Callable<F, ArgTypes...>::result_type function& operator=(F);template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes...> && Convertible<Callable<F, ArgTypes...>::result_type, R> function& operator=(F&&);... };
[ Batavia (2009-05): ]
We briefly discussed whether we ought support moveable function objects, but decided that should be a separate issue if someone cares to propose it.
Move to Tentatively Ready.
[ 2009-05-01 Daniel adds: ]
1024 modifies the second removed constructor.
The synopsis in [func.wrap.func] says:
template<Returnable R, CopyConstructible... ArgTypes> class function<R(ArgTypes...)> { ... template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes...> && Convertible<Callable<F, ArgTypes...>::result_type, R> function(F); template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes...> && Convertible<Callable<F, ArgTypes...>::result_type, R> function(F&&); ... template<class F, Allocator Alloc> function(allocator_arg_t, const Alloc&, F); template<class F, Allocator Alloc> function(allocator_arg_t, const Alloc&, F&&); ... template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes..> && Convertible<Callable<F, ArgTypes...>::result_type function& operator=(F); template<class F> requires CopyConstructible<F> && Callable<F, ArgTypes...> && Convertible<Callable<F, ArgTypes...>::result_type, R> function& operator=(F&&); ... };
Each of the 3 pairs above are ambiguous. We need only one of each pair, and we could do it with either one. If we choose the F&& version we need to bring decay into the definition to get the pass-by-value behavior. In the proposed wording I've gotten lazy and just used the pass-by-value signature.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg580 |
2010-10-21 18:28:33 | admin | set | messages: + msg579 |
2010-10-21 18:28:33 | admin | set | messages: + msg578 |
2009-03-19 00:00:00 | admin | create |