Extensible Literals (revision 2)
Ian McIntosh, Michael Wong, Raymond H. Mak, Robert Klarer · 2007
This paper is Revision 2 of n1892[ n1892] and proposes additional forms of literals using modified syntax and semantics to provide extensible user-defined literals. Extensible literals allow user-defined classes to provide new literal syntaxes and / or data representations, capabilities previously available only for basic types. It increases compatibility with C99 and with future C enhancements as well more flexible C++ literals An extensible literal translation operator function defines the literal syntax it accepts, and translates that to the data representation. This proposal limits the solution to the suffix form. The proposal requires a fairly simple change to the core language. It has been presented since 205 Tremblant meeting and has been greeted with a desire to support this feature, but we have no way of resolving the implementation difficulties. Daveed Vandevoorde offered a solution in Oxford which is essentially presented in this paper.