Nested class template argument deduction
Section [over.match.class.deduct]
John Spicer

Created on 2021-01-26.00:00:00 last changed 2 months ago


Date: 2021-03-15.00:00:00

Notes from the March, 2021 teleconference:

CWG agreed that the intent is to use the partially-instantiated inner template with the explicitly-specified template argument int.

Date: 2021-01-26.00:00:00

Consider the following example:

  template<class T> struct S {
    template<class U> struct N {
      N(T) {}
      N(T, U) {}
      template<class V> N(V, U) {}
  S<int>::N x{2.0, 1};

The description of CTAD in [over.match.class.deduct] doesn't really specify how nested classes work. If you are supposed to deduce all the enclosing class template arguments, the example is ill-formed because there is no way to deduce T. If you are supposed to consider S<int>::N as having a new constructor template, then it should probably be well-formed.

Date User Action Args
2021-11-15 00:00:00adminsetmessages: + msg6539
2021-11-15 00:00:00adminsetstatus: open -> drafting
2021-01-26 00:00:00admincreate