Boost logo

Boost :

Subject: Re: [boost] [config/multiprecision/units/general] Do we have a policy for user-defined-literals?
From: Marc Glisse (marc.glisse_at_[hidden])
Date: 2013-04-28 10:14:24


On Sun, 28 Apr 2013, Marc Glisse wrote:

> On Sun, 28 Apr 2013, John Maddock wrote:
>
>> Decimal conversion would be next to impossible because you'd need a
>> complete compile-time-arbitary-precision-arithmetic library :-(
>
> You only need addition and shift by 1 bit, that doesn't seem so bad.

Not pretty, but here is an example, tested with gcc and clang.
Now as to how you can determine if the context is constexpr to use this
instead of more efficient runtime code...

-- 
Marc Glisse



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