Parent Directory
|
Revision Log
1 2 3 // Boost.Egg 4 // 5 // Copyright Shunsuke Sogame 2007-2008. 6 // Distributed under the Boost Software License, Version 1.0. 7 // (See accompanying file LICENSE_1_0.txt or copy at 8 // http://www.boost.org/LICENSE_1_0.txt) 9 10 11 #include <boost/egg/return_of.hpp> 12 #include <boost/egg/lazy.hpp> 13 #include <boost/egg/static.hpp> 14 #include <boost/egg/bind.hpp> 15 #include <boost/egg/placeholders.hpp> 16 #include <functional> 17 18 19 #include "./egg_example.hpp" 20 21 22 //[code_example_static_compose 23 using namespace placeholders; 24 25 typedef result_of_lazy<std::plus<int>, T_bind>::type Plus; 26 typedef result_of_lazy<std::minus<int>, T_bind>::type Minus; 27 28 static_< 29 return_of< Plus, TT_1, return_of<Minus, TT_2, TT_3> > 30 >::type const foo = {{}}; 31 32 void egg_example() 33 { 34 BOOST_CHECK( foo(1,2,3) == 1+(2-3) ); 35 } 36 //]