code for exercise of book C++ Template Metaprogramming