Title
Deduction involving reference to similar types
Status
open
Section
13.10.3.2 [temp.deduct.call]
Submitter
Brian Bi

Created on 2024-12-11.00:00:00 last changed 1 month ago

Messages

Date: 2024-12-11.00:00:00

(From submission #651.)

Consider:

  #include <cstddef>

  template <std::size_t N>
  void f(const int* const (&)[N]);

  int main() {
    int* a[3];
    f(a);
  }

There is implementation divergence.

Possible resolution:

Change in 13.10.3.2 [temp.deduct.call] bullet 4.1 as follows:

  • If the original P is a reference type, the deduced A (i.e., the type referred to by the reference) can be more cv-qualified than a type similar to the transformed A that is reference-compatible with the transformed A.
  • ...
History
Date User Action Args
2024-12-11 00:00:00admincreate