delete.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*==============================================================================
  2. Copyright (c) 2001-2010 Joel de Guzman
  3. Copyright (c) 2010 Thomas Heller
  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_OBJECT_DELETE_HPP
  8. #define BOOST_PHOENIX_OBJECT_DELETE_HPP
  9. #include <boost/phoenix/core/limits.hpp>
  10. #include <boost/phoenix/core/expression.hpp>
  11. #include <boost/phoenix/core/meta_grammar.hpp>
  12. #include <boost/phoenix/core/call.hpp>
  13. BOOST_PHOENIX_DEFINE_EXPRESSION(
  14. (boost)(phoenix)(delete_)
  15. , (meta_grammar)
  16. )
  17. namespace boost { namespace phoenix
  18. {
  19. struct delete_eval
  20. {
  21. typedef void result_type;
  22. template <typename P, typename Context>
  23. result_type
  24. operator()(P const& p, Context const &ctx) const
  25. {
  26. delete boost::phoenix::eval(p, ctx);
  27. }
  28. };
  29. template <typename Dummy>
  30. struct default_actions::when<rule::delete_, Dummy>
  31. : call<delete_eval>
  32. {};
  33. template <typename P>
  34. inline
  35. typename expression::delete_<P>::type const
  36. delete_(P const& p)
  37. {
  38. return expression::delete_<P>::make(p);
  39. }
  40. }}
  41. #endif