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