• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*==============================================================================
2     Copyright (c) 2001-2010 Joel de Guzman
3     Copyright (c) 2010 Thomas Heller
4 
5     Distributed under the Boost Software License, Version 1.0. (See accompanying
6     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #ifndef BOOST_PHOENIX_OBJECT_DELETE_HPP
9 #define BOOST_PHOENIX_OBJECT_DELETE_HPP
10 
11 #include <boost/phoenix/core/limits.hpp>
12 #include <boost/phoenix/core/expression.hpp>
13 #include <boost/phoenix/core/meta_grammar.hpp>
14 #include <boost/phoenix/core/call.hpp>
15 
16 BOOST_PHOENIX_DEFINE_EXPRESSION(
17     (boost)(phoenix)(delete_)
18   , (meta_grammar)
19 )
20 
21 namespace boost { namespace phoenix
22 {
23     struct delete_eval
24     {
25         typedef void result_type;
26 
27         template <typename P, typename Context>
28         result_type
operator ()boost::phoenix::delete_eval29         operator()(P const& p, Context const &ctx) const
30         {
31             delete boost::phoenix::eval(p, ctx);
32         }
33     };
34 
35     template <typename Dummy>
36     struct default_actions::when<rule::delete_, Dummy>
37         : call<delete_eval>
38     {};
39 
40     template <typename P>
41     inline
42     typename expression::delete_<P>::type const
delete_(P const & p)43     delete_(P const& p)
44     {
45         return expression::delete_<P>::make(p);
46     }
47 
48 }}
49 
50 #endif
51