Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:19

0001 ///////////////////////////////////////////////////////////////////////////////
0002 /// \file null.hpp
0003 /// Definintion of null_context\<\>, an evaluation context for
0004 /// proto::eval() that simply evaluates each child expression, doesn't
0005 /// combine the results at all, and returns void.
0006 //
0007 //  Copyright 2008 Eric Niebler. Distributed under the Boost
0008 //  Software License, Version 1.0. (See accompanying file
0009 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 #ifndef BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007
0012 #define BOOST_PROTO_CONTEXT_NULL_HPP_EAN_06_24_2007
0013 
0014 #include <boost/preprocessor/iteration/iterate.hpp>
0015 #include <boost/preprocessor/repetition/repeat.hpp>
0016 #include <boost/proto/proto_fwd.hpp>
0017 #include <boost/proto/eval.hpp>
0018 #include <boost/proto/traits.hpp>
0019 
0020 namespace boost { namespace proto { namespace context
0021 {
0022 
0023     template<
0024         typename Expr
0025       , typename Context
0026       , long Arity          // = Expr::proto_arity_c
0027     >
0028     struct null_eval
0029     {};
0030 
0031     template<typename Expr, typename Context>
0032     struct null_eval<Expr, Context, 0>
0033     {
0034         typedef void result_type;
0035         void operator()(Expr &, Context &) const
0036         {}
0037     };
0038 
0039     // Additional specializations generated by the preprocessor
0040     #include <boost/proto/context/detail/null_eval.hpp>
0041 
0042     /// null_context
0043     ///
0044     struct null_context
0045     {
0046         /// null_context::eval
0047         ///
0048         template<typename Expr, typename ThisContext = null_context const>
0049         struct eval
0050           : null_eval<Expr, ThisContext>
0051         {};
0052     };
0053 
0054 }}}
0055 
0056 #endif