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

2024-04-18


2057. Template template arguments with default arguments

Section: 13.4.4  [temp.arg.template]     Status: drafting     Submitter: Jonathan Caves     Date: 2014-12-12

It is not clear how to handle an example like:

  template<typename T1, typename T2 = char> class A { };

  template<template<typename... T> class X> class S {
    X<int> x;
  };

  S<A> a;

Issue 184 dealt with a similar question but did so in the era before variadic templates. This usage should be permitted in modern C++.

Notes from the February, 2016 meeting:

CWG felt that this usage should be permitted, but only for template template parameters with a parameter pack.. Furthermore, if the template template parameter has a default argument followed by a parameter pack, the parameter's default argument would be used, followed by any remaining default arguments from the template template argument.