Title
The protected virtual member functions of memory_resource should be private
Status
c++17
Section
[mem.res.class]
Submitter
Ville Voutilainen

Created on 2016-06-04.00:00:00 last changed 90 months ago

Messages

Date: 2016-06-20.16:35:58

Proposed resolution:

This wording is relative to N4582.

  1. Modify [memory.resource.class] as indicated:

    class memory_resource {
      […]
    protectedprivate:
      virtual void* do_allocate(size_t bytes, size_t alignment) = 0;
      virtual void do_deallocate(void* p, size_t bytes, size_t alignment) = 0;
      virtual bool do_is_equal(const memory_resource& other) const noexcept = 0;
    };
    
  2. Modify [memory.resource.prot] as indicated:

    [Drafting note: I don't know whether it's too late to change the section mnemonic [memory.resource.prot] to e.g. [memory.resource.priv] or perhaps [memory.resource.virt].]

    memory_resource protectedprivate virtual member functions [memory.resource.prot]

Date: 2016-06-28.13:14:43

[ 2016-06 Oulu ]

Looks fine, check with Pablo to make sure that was his intent.

Pablo replied that this was correct.

Friday: status to Immediate

Date: 2016-06-04.00:00:00

memory_resource doesn't define any behavior, it's just an interface. Furthermore, we don't say whether the functions at [memory.resource.prot] should or should not be defined by implementations. Presumably they should not. Those functions are not designed to be called by derived classes, and thus should not be protected.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-06-28 13:14:43adminsetstatus: immediate -> wp
2016-06-27 16:42:33adminsetstatus: new -> immediate
2016-06-20 16:35:58adminsetmessages: + msg8183
2016-06-05 19:06:56adminsetmessages: + msg8170
2016-06-04 00:00:00admincreate