Date
2015-12-05.00:00:00
Message id
7649

Content

Addresses: fund.ts.v2

[This is essentially LWG 2370, but deals with the fundamentals TS version rather than the one in the standard]

In [func.wrap.func] of library fundamentals TS, the constructors

template<class A> function(allocator_arg_t, const A&) noexcept;
template<class A> function(allocator_arg_t, const A&, nullptr_t) noexcept;

must type-erase and store the provided allocator, since the operator= specification requires using the "allocator specified in the construction of" the std::experimental::function object. This may require a dynamic allocation and so cannot be noexcept. Similarly, the following constructors

template<class A> function(allocator_arg_t, const A&, const function&); 
template<class A> function(allocator_arg_t, const A&, function&&);
template<class F, class A> function(allocator_arg_t, const A&, F);

cannot satisfy the C++14 requirement that they "shall not throw exceptions if [the function object to be stored] is a callable object passed via reference_wrapper or a function pointer" if they need to type-erase and store the allocator.