Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:01:52

0001 /*=============================================================================
0002     Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com)
0003     http://spirit.sourceforge.net/
0004 
0005   Distributed under the Boost Software License, Version 1.0. (See accompanying
0006   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 =============================================================================*/
0008 #ifndef BOOST_SPIRIT_ACTOR_DECREMENT_ACTOR_HPP
0009 #define BOOST_SPIRIT_ACTOR_DECREMENT_ACTOR_HPP
0010 
0011 #include <boost/spirit/home/classic/namespace.hpp>
0012 #include <boost/spirit/home/classic/actor/ref_actor.hpp>
0013 
0014 namespace boost { namespace spirit {
0015 
0016 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
0017 
0018     ///////////////////////////////////////////////////////////////////////////
0019     //  Summary:
0020     //  A semantic action policy that calls the -- operator on a reference.
0021     //  (This doc uses convention available in actors.hpp)
0022     //
0023     //  Actions:
0024     //      --ref;
0025     //
0026     //  Policy name:
0027     //      decrement_action
0028     //
0029     //  Policy holder, corresponding helper method:
0030     //      ref_actor, decrement_a( ref );
0031     //
0032     //  () operators: both.
0033     //
0034     //  See also ref_actor for more details.
0035     ///////////////////////////////////////////////////////////////////////////
0036     struct decrement_action
0037     {
0038         template<
0039             typename T
0040         >
0041         void act(T& ref_) const
0042         {
0043             --ref_;
0044         }
0045     };
0046 
0047     ///////////////////////////////////////////////////////////////////////////
0048     // helper method that creates a and_assign_actor.
0049     ///////////////////////////////////////////////////////////////////////////
0050     template<typename T>
0051     inline ref_actor<T,decrement_action> decrement_a(T& ref_)
0052     {
0053         return ref_actor<T,decrement_action>(ref_);
0054     }
0055 
0056 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0057 
0058 }}
0059 
0060 #endif