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

2024-12-19


1878. operator auto template

Section: 9.2.9.7  [dcl.spec.auto]     Status: CD4     Submitter: Daveed Vandevoorde     Date: 2014-02-20

[Moved to DR at the November, 2014 meeting.]

The Standard currently appears to allow something like

  struct S {
    template<class T> operator auto() { return 42; }
  };

This is of very limited utility and presents difficulties for some implementations. It might be good to prohibit such constructs.

Proposed resolution (October, 2014):

Add the following as the last paragraph of 11.4.8.3 [class.conv.fct]:

A conversion function template shall not have a deduced return type (9.2.9.7 [dcl.spec.auto]).