Title
Temporary materialization and base/member initialization
Status
open
Section
11.9.3 [class.base.init]
Submitter
Daveed Vandevoorde

Created on 2018-12-11.00:00:00 last changed 36 months ago

Messages

Date: 2018-12-11.00:00:00

Given the following example,

  struct Noncopyable {
    Noncopyable();
    Noncopyable(const Noncopyable &) = delete;
  };

  Noncopyable make(int kind = 0);

  struct AsBase : Noncopyable {
    AsBase() : Noncopyable(make()) {} // #1
  };

  struct AsMember {
    Noncopyable nc;
    AsMember() : nc(make()) { }  // #2?
  };

All implementations treat #1 as an error, invoking the deleted copy constructor, while #2 is accepted. It's not clear from the current wording why they should be treated differently.

History
Date User Action Args
2018-12-11 00:00:00admincreate