Title
[fund.ts.v2] Contradiction in set_default_resource specification
Status
open
Section
[memory.resource.global]
Submitter
Tim Song

Created on 2015-07-28.00:00:00 last changed 81 months ago

Messages

Date: 2015-11-04.16:49:21

Proposed resolution:

This wording is relative to N4529.

  1. Edit [memory.resource.global]/p8 as follows:

    -6- memory_resource* set_default_resource(memory_resource* r) noexcept;
    

    -7- Effects: If r is non-null, sets the value of the default memory resource pointer to r, otherwise sets the default memory resource pointer to new_delete_resource().

    -8- Postconditions: get_default_resource() == r.

    […]

Date: 2015-10-26.00:00:00

[ 2015-10-26 ]

Daniel adjusts wording to lib. fund. v2.

Date: 2015-11-04.16:49:21

[ 2015-10, Kona Saturday afternoon ]

Move to Tentatively ready

Date: 2015-09-15.00:00:00

[ 2015-09-15 Geoffrey Romer comments and suggests alternative wording ]

Let's just strike [memory.resource.global]/p8. The problem is that p8 is restating p7 incorrectly, but the solution is not to restate p7 correctly, it's to stop trying to restate p7 at all.

Date: 2015-10-26.20:17:22

Addresses: fund.ts.v2

[memory.resource.global]/p7-8 says that the effects of set_default_resource(r) are

If r is non-null, sets the value of the default memory resource pointer to r, otherwise sets the default memory resource pointer to new_delete_resource().

and the operation has the postcondition

get_default_resource() == r.

When r is null, however, the postcondition cannot be met, since the call sets the default memory resource pointer to new_delete_resource(), and so get_default_resource() would return the value of new_delete_resource(), which is obviously not null and so cannot compare equal to r.

Previous resolution from Tim Song [SUPERSEDED]:

This wording is relative to N4480.

  1. Edit [memory.resource.global]/p8 as follows:

    -6- memory_resource* set_default_resource(memory_resource* r) noexcept;
    

    -7- Effects: If r is non-null, sets the value of the default memory resource pointer to r, otherwise sets the default memory resource pointer to new_delete_resource().

    -8- Postconditions: get_default_resource() == r if r is non-null; otherwise, get_default_resource() == new_delete_resource().

    […]

History
Date User Action Args
2017-07-30 20:10:41adminsetstatus: wp -> open
2016-03-07 04:18:55adminsetstatus: ready -> wp
2015-11-04 16:49:21adminsetmessages: + msg7613
2015-11-04 16:49:21adminsetstatus: new -> ready
2015-10-26 20:17:22adminsetmessages: + msg7583
2015-09-15 17:49:40adminsetmessages: + msg7525
2015-08-19 19:32:18adminsetmessages: + msg7495
2015-07-28 00:00:00admincreate