Background
Unfortunately, the current C ++ standard does not have the exact width types C99 defined in the header stdint.
The next best thing I could find (in terms of portability) was the implementation Boost cstdint.hppfrom the library Boost.Integer.
Concern
However, I have a few problems with this:
Boostthe implementation resets everything typedefin boost namesapce(instead of something like boost::stdint). This is absolutely ugly, because now you are either forced to use the directive usingonly for the types you are interested in (this is an additional maintenance task), or bring everything boost namespaceto the global scope (this defeats point namespaces). I could, of course, be verbose and print boost::uint32_teverywhere, for example, but this is also not very convenient for the future.
Questions
I am mainly looking for advice. What is the best way to use these not-yet-standard (not in C ++ '03, anyway) types as transparent as possible?
, , ? boost namespace namespace, "boost::", , Boost.Integer cstdint.hpp ..?
.
, (, , ), , .
1 - - , / class template, .
2 - stdint.h cstdint, "boost::". , (.. "Boost/cstdint.hpp" ), .
Senelt