/** * @file pop_actor.h * * @brief An actor to pop a vector/container, based off of the clear_actor * * @date Dec 8, 2011 * @author Alex Cunningham */ #pragma once #include namespace boost { namespace spirit { BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN /////////////////////////////////////////////////////////////////////////// // Summary: // A semantic action policy that calls pop_back method. // (This doc uses convention available in actors.hpp) // // Actions (what it does): // ref.pop_back(); // // Policy name: // clear_action // // Policy holder, corresponding helper method: // ref_actor, clear_a( ref ); // // () operators: both. // // See also ref_actor for more details. /////////////////////////////////////////////////////////////////////////// struct pop_action { template< typename T > void act(T& ref_) const { ref_.pop_back(); } }; /////////////////////////////////////////////////////////////////////////// // helper method that creates a and_assign_actor. /////////////////////////////////////////////////////////////////////////// template inline ref_actor pop_a(T& ref_) { return ref_actor(ref_); } BOOST_SPIRIT_CLASSIC_NAMESPACE_END }}