Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-07-13 09:15:28


Sounds very useful - if only occasionally (in the absence of a binary input
option addition to C++0X which I haven't heard proposed - Ada allows ANY
base, of course, so C++ is way behind).

Can you post reference to discussion and perhaps append the binary_int.hpp
file as it sounds quite short?

Thanks

Paul

Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539 561830 +44 7714 330204
mailto: pbristow_at_[hidden]

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Scott Schurr
| Sent: 12 July 2005 23:32
| To: boost_at_[hidden]
| Subject: [boost] Interest in a binary_int template for binary
| literals?
|
| Greetings,
|
| Prompted by some discussion on comp.sdt.c++.moderated, I have a
| small template that allows the user to declare an integer literal
| in binary.
|
| Usage looks like:
|
| #include "binary_int.hpp"
|
| unsigned int binary = binary_int<1001,0011,1011,0000>::b;
|
| The template is written to support up to 64 bits, although my
| compiler only allows me test up to 32 bits. I intend to use it
| for programming hardware registers in the language of the hardware
| folk at my company.
|
| The template is only about 150 lines and doesn't really deserve a
| library, but it could potentially be tucked into another library
| if it is deemed useful.
|
| Thanks.
|
| Scott Schurr
|
| _______________________________________________
| Unsubscribe & other changes:
| http://lists.boost.org/mailman/listinfo.cgi/boost
|


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