Title
Initializer-list arguments and pack deduction
Status
cd4
Section
13.10.3.2 [temp.deduct.call]
Submitter
Hubert Tong

Created on 2015-06-22.00:00:00 last changed 87 months ago

Messages

Date: 2015-09-15.00:00:00

Proposed resolution (September, 2015):

Change 13.10.3.2 [temp.deduct.call] paragraph 1 as follows:

...For a function parameter pack that occurs at the end of the parameter-declaration-list, the type A of deduction is performed for each remaining argument of the call, is compared with taking the type P of the declarator-id of the function parameter pack as the corresponding function template parameter type. Each comparison deduction deduces template arguments for subsequent positions in the template parameter packs expanded by the function parameter pack. When a function parameter pack appears in a non-deduced context (13.10.3.6 [temp.deduct.type]), the type of that parameter pack is never deduced. [Example:...
Date: 2016-02-15.00:00:00

[Adopted at the February, 2016 meeting.]

The current wording of 13.10.3.2 [temp.deduct.call] paragraph 1 dealing with deduction for a trailing parameter pack refers to “the type” of the argument, which does not apply to an initializer list. There is implementation divergence in the handling of an example like

  #include <initializer_list>

  template <typename... T>
  void q(std::initializer_list<std::initializer_list<T>>... tt);

  void bar() { q({{0}}, {{'\0'}}); }
History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: tentatively ready -> cd4
2015-11-10 00:00:00adminsetmessages: + msg5615
2015-06-22 00:00:00admincreate