Boost logo

Boost :

Subject: Re: [boost] [config/multiprecision/units/general] Do we have a policy for user-defined-literals?
From: John Maddock (john_at_[hidden])
Date: 2013-04-28 04:04:19


>> 3) How should the suffixes be named? There is an obvious possibility
>> for clashes here - for example the units lib would probably want to use
>> _s for seconds, but no doubt other users might use it for strings and
>> such like. We could insist that all such names added to a boost lib are
>> suitably mangled, so "_bu_s" for boost.units.seconds, but I'm not
>> convinced by that. Seems to make the feature much less useful?
>>
>
> I think we should just use the obvious short names,
> and rely on users not to bring conflicting suffixes
> into scope. If there's a conflict they can always
> fall back on normal constructors.

Nod. Short names are my preference too.

Note however, that constructors may be less efficient in general - cpp_int
users would have to fall back on a construct-from-string rather than
constexpr initialisation (the issue is you can't write a number with enough
digits unless it has a user-defined-suffix).

John.


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