Date
2009-03-19.00:00:00
Message id
577

Content

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.