Boost logo

Boost :

Subject: Re: [boost] Library proposal: binconst, constant of the binary form.
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-01-15 07:14:11


TaeKyeong Wang wrote:
> C++ programmers want to input a constant of the binary form, like
> following. But, this is illegal in C++ world.
>
> unsigned char value = 0b10001010;
>
> There are some solutions of this lack. But, I can't find the gratifying answer.
>
> This proposal has following features.
>
> - whether digits is binary form
> - whether digits is octal or decimal of binary form
> - range of input octal or decimal number detection
> - output value is absolutely constant, no charge of resource
> (code, memory) at a run-time

Why not make it more generic and support any base?


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