Title
Conversion function templates and qualification conversions
Status
cd5
Section
13.10.3.4 [temp.deduct.conv]
Submitter
John Spicer

Created on 2018-07-24.00:00:00 last changed 77 months ago

Messages

Date: 2019-02-15.00:00:00

[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

    cv1,0 “pointer to...” cv1,n-1 “pointer to” cv1,n T1

and P is a type

    cv2,0 “pointer to...” cv2,n-1 “pointer to” cv2,n T2

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

    cv1,0 “pointer to...” cv1,n-1 “pointer to” cv1,n T1

and P is a type

    cv2,0 “pointer to...” cv2,n-1 “pointer to” cv2,n T2

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]

History
Date User Action Args
2018-07-24 00:00:00admincreate