1 /*============================================================================== 2 Copyright (c) 2005-2010 Joel de Guzman 3 4 Distributed under the Boost Software License, Version 1.0. (See accompanying 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 ==============================================================================*/ 7 #ifndef BOOST_PHOENIX_CORE_NOTHING_HPP 8 #define BOOST_PHOENIX_CORE_NOTHING_HPP 9 10 #include <boost/phoenix/core/limits.hpp> 11 #include <boost/mpl/void.hpp> 12 #include <boost/phoenix/core/actor.hpp> 13 #include <boost/phoenix/core/call.hpp> 14 #include <boost/phoenix/core/expression.hpp> 15 #include <boost/phoenix/core/value.hpp> 16 17 namespace boost { namespace phoenix 18 { 19 ///////////////////////////////////////////////////////////////////////////// 20 // 21 // null_actor 22 // 23 // An actor that does nothing (a "bum", if you will :-). 24 // 25 ///////////////////////////////////////////////////////////////////////////// 26 27 namespace detail 28 { 29 struct nothing {}; 30 } 31 32 namespace expression 33 { 34 struct null 35 : expression::value<detail::nothing> 36 {}; 37 } 38 39 template<typename Dummy> 40 struct is_custom_terminal<detail::nothing, Dummy> 41 : mpl::true_ 42 {}; 43 44 template<typename Dummy> 45 struct custom_terminal<detail::nothing, Dummy> 46 { 47 typedef void result_type; 48 template <typename Context> operator ()boost::phoenix::custom_terminal49 void operator()(detail::nothing, Context &) const 50 { 51 } 52 }; 53 54 typedef expression::null::type nothing_type BOOST_ATTRIBUTE_UNUSED; 55 #ifndef BOOST_PHOENIX_NO_PREDEFINED_TERMINALS 56 nothing_type const BOOST_ATTRIBUTE_UNUSED nothing = {{{}}}; 57 #endif 58 }} 59 60 #endif 61