Suffix for basic_string literals

Howard Hinnant hhinnant at
Tue Jul 23 09:46:29 PDT 2013

On Jul 23, 2013, at 11:17 AM, Marshall Clow <mclow.lists at> wrote:

> On Jul 22, 2013, at 2:09 PM, Marshall Clow <mclow.lists at> wrote:
>> Implements the "s" suffix for basic_string literals as called for in N3642 + tests.
> Now that clang implements these literal suffixes (thanks Richard!), here's an updated patch.

Very nicely done!

Two nits:

1.  basic.string.literals should be a sibling of basic.string instead of a child of it.


#if _LIBCPP_STD_VER > 11 
// Literal suffixes for basic_string [basic.string.literals]
/* inline */ namespace literals

How about instead something along the lines of:

#if _LIBCPP_STD_VER > 11 
// Literal suffixes for basic_string [basic.string.literals]
// inline // Deviation from N3690.
//    We believe the inline to be a defect and have submitted an LWG issue.
//    An LWG issue number has not yet been assigned.
namespace literals

Please commit with these fixes.  Thanks!

For others:  Marshall and I took this issue to the LWG mailing list for discussion.  We have seen no complaints with this course of action.  Having inline on namespace literals contradicts the rationale given in N3642:

> As a common schema this paper proposes to put all suffixes for user defined literals in separate inline namespaces that are below the inline namespace std::literals. [ Note: This allows a user either to do a using namespace std::literals; to import all literal operators from the standard available through header file inclusion, or to use using namespace std::string_literals; to just obtain the literals operators for a specific type. —endnote]


More information about the cfe-commits mailing list