This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


2384. Conversion function templates and qualification conversions

Section: 13.10.3.4  [temp.deduct.conv]     Status: CD5     Submitter: John Spicer     Date: 2018-07-24

[Accepted as a DR at the February, 2019 meeting.]

Issue 349 resulted in the following specification in 13.10.3.4 [temp.deduct.conv] paragraph 7:

When the deduction process requires a qualification conversion for a pointer or pointer-to-member type as described above, the following process is used to determine the deduced template argument values: If A is a type

and P is a type

then the cv-unqualified T1 and T2 are used as the types of A and P respectively for type deduction. [Example:

  struct A {
    template <class T> operator T***();
  };
  A a;
  const int * const * const * p1 = a; // T is deduced as int, not const int

end example]

This rule is not widely implemented and may not be desirable. Should it be removed?

Proposed resolutions (December, 2018):

Delete 13.10.3.4 [temp.deduct.conv] paragraph 7:

When the deduction process requires a qualification conversion for a pointer or pointer-to-member type as described above, the following process is used to determine the deduced template argument values: If A is a type

and P is a type

then the cv-unqualified T1 and T2 are used as the types of A and P respectively for type deduction. [Example:

  struct A {
    template <class T> operator T***();
  };
  A a;
  const int * const * const * p1 = a; // T is deduced as int, not const int

end example]