1 /*=============================================================================
2 Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com)
3 http://spirit.sourceforge.net/
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_SPIRIT_ACTOR_DECREMENT_ACTOR_HPP
9 #define BOOST_SPIRIT_ACTOR_DECREMENT_ACTOR_HPP
11 #include <boost/spirit/home/classic/namespace.hpp>
12 #include <boost/spirit/home/classic/actor/ref_actor.hpp>
14 namespace boost { namespace spirit {
16 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
18 ///////////////////////////////////////////////////////////////////////////
20 // A semantic action policy that calls the -- operator on a reference.
21 // (This doc uses convention available in actors.hpp)
29 // Policy holder, corresponding helper method:
30 // ref_actor, decrement_a( ref );
32 // () operators: both.
34 // See also ref_actor for more details.
35 ///////////////////////////////////////////////////////////////////////////
36 struct decrement_action
41 void act(T& ref_) const
47 ///////////////////////////////////////////////////////////////////////////
48 // helper method that creates a and_assign_actor.
49 ///////////////////////////////////////////////////////////////////////////
51 inline ref_actor<T,decrement_action> decrement_a(T& ref_)
53 return ref_actor<T,decrement_action>(ref_);
56 BOOST_SPIRIT_CLASSIC_NAMESPACE_END