diff --git a/book/chapter1/binary.hpp b/book/chapter1/binary.hpp new file mode 100755 index 0000000..4c8b724 --- /dev/null +++ b/book/chapter1/binary.hpp @@ -0,0 +1,13 @@ + +#include "boost/mpl/long.hpp" +#include "boost/mpl/alias.hpp" + +template< long n > struct binary + : mpl::long_< ( binary< n / 10 >::value << 1 ) + n % 10 > +{ +}; + +template<> struct binary<0> + : mpl::long_<0> +{ +};