Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-09-17 04:42:20


>
>> I see this is defined in boost/cstdint.hpp, but only if
>> __STDC_CONSTANT_MACROS is #defined. How does this happen? Do I #define it
>> myself, or does it get #defined some other way?
>>
>
> Any help on how to use the Boost UINT64_C macro?

Define __STDC_CONSTANT_MACROS at the start of the source *before* any std
lib headers are included, then include <boost/cstdint.hpp>. One potential
gotcha: note that the implementation of <boost/cstdint.hpp> may delegate to
the platform's stdint.h , so we're relying on that not being buggy.

Then:

boost::int64_t i = UINT64_C(0x1234567812345678);

John.


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