Date
2009-05-27.00:00:00
Message id
2083

Content

The only restriction placed on the use of “=default” in 9.6 [dcl.fct.def] paragraph 9 is that a defaulted function must be a special member function. However, there are many variations of declarations of special member functions, and it's not clear which of those should be able to be defaulted. Among the possibilities:

  • default arguments

  • by-value parameter for a copy assignment operator

  • exception specifications

  • arbitrary return values for copy assignment operators

  • a const reference parameter when the implicit function would have a non-const

Presumably, you should only be able to default a function if it is declared compatibly with the implicit declaration that would have been generated.