Title
Converting constructors in rvalue reference initialization
Status
drafting
Section
12.2.2.7 [over.match.ref]
Submitter
Mitsuru Kariya

Created on 2014-10-25.00:00:00 last changed 122 months ago

Messages

Date: 2014-11-15.00:00:00

Notes from the November, 2014 meeting:

CWG agreed that 9.4.4 [dcl.init.ref] should be changed to consider converting constructors in this case.

Date: 2014-10-25.00:00:00

Consider the following example:

  struct T {
    T() {}
    T(struct S&) {}
  };

  struct S {
    operator T() { return T(); }
  };

  int main()
  {
    S s;
    T&& t(s);  // #1
  }

Because there are two possible conversions from S to T, one by conversion function and the other by converting constructor, one might expect that the initialization at #1 would be ambiguous. However, 12.2.2.7 [over.match.ref] (used in the relevant bullet of 9.4.4 [dcl.init.ref], paragraph 5.2.1.2) only deals with conversion functions and ignores converting constructors.

History
Date User Action Args
2014-11-24 00:00:00adminsetmessages: + msg5219
2014-10-25 00:00:00admincreate