Movatterモバイル変換


[0]ホーム

URL:


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

2025-12-20


1479. Literal operators and default arguments

Section:12.6  [over.literal]    Status:CD3    Submitter:Jason Merrill    Date:2012-03-13

[Moved to DR at the April, 2013 meeting.]

It appears that an example like

  int operator"" _a (const char *, std::size_t = 0);  int operator"" _a (const char *);  int i = 123_a;

is ambiguous: although only the second declaration is a raw literaloperator, the corresponding call

  operator"" _a ("123")

could match either declaration. Should default arguments forliteral operators be prohibited?

Proposed resolution (October, 2012):

Change 12.6 [over.literal] paragraph 3 as follows:

The declaration of a literal operator shall have aparameter-declaration-clause equivalent to one of thefollowing:

...

If a parameter has a default argument (9.3.4.7 [dcl.fct.default]), the program is ill-formed.




[8]ページ先頭

©2009-2026 Movatter.jp