New paper: N3599, Literal Operator Templates for Strings -- Richard Smith

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3599

Date: 2013-03-13

Literal Operator Templates for Strings

by Richard Smith

Excerpt:

N2765 added the ability for users to define their own literal suffixes. Several forms of literal operators are available, with one notable omission: there is no template form of literal operator for character and string literals. N2750 justifies this restriction based on two factors:

  • there may be demand for a raw form of string literal, in which
    "Hello, " L"Worl\u0044!"
    is distinguishable from
    L"Hello, World!"
    but this interacted badly with phases of translation, and
  • no compelling use cases for this feature were known.

Neither of these is still true, and we now have evidence that a literal operator template for string literals would be valuable; indeed, in one codebase where literal operators are not yet permitted, this form of literal operator has been requested more frequently than any of the forms which C++11 permits.

 

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.