SCM Repositories - p-stade


Parent Directory Parent Directory | Revision Log Revision Log


Revision 2499 - (download) (annotate)
Wed Apr 2 15:03:38 2008 UTC (15 months, 1 week ago) by mb2sync
File size: 950 byte(s)
    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_< boost::mpl::always<
   29 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
   30     result_of_<Plus(TT_1, result_of_<Minus(TT_2, TT_3)>::type)>::type
   31 #else
   32     return_of<Plus(TT_1, Minus(TT_2, TT_3))>::type
   33 #endif
   34 > >::type const foo = BOOST_EGG_STATIC();
   35 
   36 void egg_example()
   37 {
   38     BOOST_CHECK( foo(1,2,3) == 1+(2-3) );
   39 }
   40 //]