#ifndef EXAMPLE_HANDCRAFTED_HPP #define EXAMPLE_HANDCRAFTED_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include typedef boost::mpl::int_<11> val; struct fib { typedef fib type; template struct impl; template struct apply : boost::mpl::eval_if< typename boost::mpl::less >::type, boost::mpl::int_<1>, impl > {}; }; template struct fib::impl : boost::mpl::plus< typename fib::apply< typename boost::mpl::minus >::type >::type, typename fib::apply< typename boost::mpl::minus >::type >::type > {}; struct fact { typedef fact type; template struct impl; template struct apply : boost::mpl::eval_if< typename boost::mpl::less >::type, boost::mpl::int_<1>, impl > {}; }; template struct fact::impl : boost::mpl::times< N, typename fact::apply< typename boost::mpl::minus >::type >::type > {}; struct times4 { typedef times4 type; template struct apply : double_number::type> {}; }; struct times11 { typedef times11 type; template struct apply : boost::mpl::times {}; }; #endif