This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.

1258. std::function Effects clause impossible to satisfy

Section: 22.10.17.3.3 [func.wrap.func.mod] Status: Resolved Submitter: Daniel Krügler Opened: 2009-11-05 Last modified: 2016-01-28

Priority: Not Prioritized

View all issues with Resolved status.

Discussion:

As of 22.10.17.3.3 [func.wrap.func.mod]/2+ we have the following prototype description:

template<class F, Allocator Alloc>
  void assign(F, const Alloc&);

Effects: function(f, a).swap(*this)

Two things: First the concept debris needs to be removed, second and much more importantly, the effects clause is now impossible to satisfy, because there is no constructor that would match the parameter sequence (FunctionObject, Allocator) [plus the fact that no f and no a is part of the signature]. The most probable candidate is

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

and the effects clause needs to be adapted to use this signature.

[ 2009-11-13 Daniel brought wording up to date. ]

[ 2009-11-15 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

[ 2010-02-11 Moved to Tentatively NAD Editorial after 5 positive votes on c++std-lib. It was noted that this issue was in partial conflict with 1288, and the two issues were merged in 1288. ]

Rationale:

Addressed by 1288.

Proposed resolution:

Change in 22.10.17.3.3 [func.wrap.func.mod] the complete prototype description as indicated

[ Question to the editor: Shouldn't there a paragraph number in front of the Effects clause? ]

template<class F, Allocator Allocclass A>
  void assign(F f, const Alloc& a);

3 Effects: function(f, aallocator_arg, a, f).swap(*this)