3 ms·
Boost has a macro that's usable in plain C as well, since it uses only the preprocessor. #include <boost/utility/binary.hpp> char c = BOOST_BINARY(01011010
by kps 13y ago
Boost has a macro that's usable in plain C as well, since it uses only the preprocessor.
#include <boost/utility/binary.hpp>
char c = BOOST_BINARY(01011010);
- stingraycharles 13y agoYeah but that is a but similar as BOOST_FOREACH before c++11 -- it just isn't making things any prettier. I think most people nowadays are conditioned to parse the enum-as-bitmasks 0x01, 0x02, 0x04, 0x08 etc, so i would be reluctant to use boost's version in that case. The new operator, however, seems pretty sweet for that use case!