Title
[fund.ts.v2] Incorrect precondition for experimental::function::swap
Status
open
Section
[func.wrap.func.mod]
Submitter
Tim Song

Created on 2015-08-04.00:00:00 last changed 81 months ago

Messages

Date: 2015-10-26.20:17:22

Proposed resolution:

This wording is relative to N4529.

  1. Edit [func.wrap.func.mod] as indicated:

    void swap(function& other);
    

    -2- Requires: *this->get_memory_resource() == *other->.get_memory_resource().

    -3- Effects: Interchanges the targets of *this and other.

    -4- Remarks: The allocators of *this and other are not interchanged.

Date: 2015-10-26.00:00:00

[ 2015-10-26 ]

Daniel adjusts wording to lib. fund. v2.

Date: 2015-09-15.00:00:00

[ 2015-09-11, Telecon ]

Move to Tentatively Ready

Date: 2015-10-26.20:17:22

Addresses: 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.

History
Date User Action Args
2017-07-30 20:10:41adminsetstatus: wp -> open
2015-11-16 02:13:05adminsetstatus: ready -> wp
2015-10-26 20:17:22adminsetmessages: + msg7585
2015-09-14 21:38:11adminsetmessages: + msg7520
2015-09-14 21:38:11adminsetstatus: new -> ready
2015-08-21 17:32:01adminsetmessages: + msg7502
2015-08-04 00:00:00admincreate