Boost logo

Boost :

Subject: Re: [boost] Interest in UDL suffixes for built-in and some standard library types?
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-09-08 10:40:44


Le 05/09/12 17:57, Peter Sommerlad a écrit :
> Dear boost members,
>
> I am preparing a paper for the next C++ standardization meeting for providing user-defined-literals for some standard types.
>
> b (and a variety of derivations lik bULL) for binary integer literals as in 101b
> s for std::string as "hello, world!"s
> s, h, min, etc. for std::chrono::duration literals such as 0xfh for 15 hours
> i, r for creating std::complex literals
>
> see http://wiki.hsr.ch/PeterSommerlad/wiki.cgi?LiteralsForBinaryStringComplexDuration
> for the paper draft.
>
> It also includes machinery to parse integers using the template version of a user-defined literal, because using
> constexpr operator"" foo(unsigned long long bar);
> overload loses the ability to treat the number bar as a compile-time constant, e.g., to use as template argument further on.
>
> Some people told me, such a facility would be nice in its own way, to be used by other authors of UDL constexpr overloads.
>
> I wonder if there is interest to provide standard conforming versions of my implementation (including the required _ prefix) for boost (which would require to clean up things a bit beforehand).
>
> Such a boost.suffixes library would only work with C++11 capable compilers that actually implement UDL and constexpr in combination (for some uses the constexpr is not required). gcc4.7.1 is fine, for example, my version of clang didn't do constexpr yet (that might have changed).
>
> Feedback, encouragement and thoughts are welcome.
>

Hi,

I'm really interested. I planned to implement them for Boost.Chrono. Of
course if you want to provide a standalone library I have no problem. If
you need help adapting your code to Boost, please contact me directly,
it will be a pleasure to help in this task.

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk