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

2024-03-20


1979. Alias template specialization in template member definition

Section: 13.7.8  [temp.alias]     Status: drafting     Submitter: Gabriel Dos Reis     Date: 2014-07-31

In an example like

  template<typename T> struct A {
    struct B {
      void f();
    };
  };

  template<typename T> using X = typename A<T>::B;

  template<typename T> void X<T>::f() { }       // #1

should #1 be considered a definition of A<T>::B::f()?

Analogy with alias-declarations would suggest that it should, but alias template specializations involve issues like SFINAE on unused template parameters (see issue 1558) and possibly other complications.

(See also issues 1980, 2021, 2025, and 2037.)

Notes from the May, 2015 meeting:

CWG felt that this kind of usage should be permitted only via a “simple” alias, in which the SFINAE is the same as the template to which it refers and all the template parameters are used. See also issue 1286.