This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TS status.
Section: 4.2.2 [fund.ts.v2::func.wrap.func.mod] Status: TS Submitter: Tim Song Opened: 2015-08-04 Last modified: 2017-07-30
View all issues with TS status.
4.2.2 [fund.ts.v2::func.wrap.func.mod] says that the precondition of swap is
this->get_memory_resource() == other->get_memory_resource()
That compares two pointers and so requires the memory resource used by *this and other to be the exact same object. That doesn't seem correct (for one, it would essentially outlaw swapping all functions constructed with "plain" allocators, since they would each have their own resource_adaptor object and so the pointers will not compare equal). Presumably the intent is to compare the memory_resources for equality.
Also, other is a reference, not a pointer.
Move to Tentatively Ready
Daniel adjusts wording to lib. fund. v2.
This wording is relative to N4529.
Edit 4.2.2 [fund.ts.v2::func.wrap.func.mod] as indicated:
void swap(function& other);
-2- Requires: this->get_memory_resource() == other-3- Effects: Interchanges the targets of *this and other. -4- Remarks: The allocators of *this and other are not interchanged.