This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Implement N3642 - User-defined Literals for Standard Library Types


Greetings,

This patch implements N3642 - User-defined literals for std::chrono::duration and std::basic_string
and N3660 - User-defined literals for std::complex.

User-defined literals were separated into two papers because of some controversy about noexcept for complex literals. If desired, I could split the patch into two bits for the two proposals. OTOH, I'm pretty sure complex literals will make it in.

The patch includes a utility for compile-time parsing of integers which is a modified version of that suggested in N3642. Support for binary literals of the form 0b01010 and support for a digit separator are added relative to that paper.
The digit parsing is used in the chrono literals.

One bit: I would like someone to look over my treatment of namespace versioning and tell me if that's OK
and/or whether I need to mess with gnu-versioned-namespace.ver.

Otherwise, this builds and tests clean on x86_64-linux.

Thanks,
Ed

Attachment: CL_stdliterals
Description: Text document

Attachment: patch_stdliterals
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]