File indexing completed on 2025-01-31 10:01:52
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_SPIRIT_ACTOR_PUSH_FRONT_ACTOR_HPP
0009 #define BOOST_SPIRIT_ACTOR_PUSH_FRONT_ACTOR_HPP
0010
0011 #include <boost/spirit/home/classic/namespace.hpp>
0012 #include <boost/spirit/home/classic/actor/ref_value_actor.hpp>
0013 #include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp>
0014
0015 namespace boost { namespace spirit {
0016
0017 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 struct push_front_action
0043 {
0044 template<
0045 typename T,
0046 typename ValueT
0047 >
0048 void act(T& ref_, ValueT const& value_) const
0049 {
0050 ref_.push_front( value_ );
0051 }
0052 template<
0053 typename T,
0054 typename IteratorT
0055 >
0056 void act(
0057 T& ref_,
0058 IteratorT const& first_,
0059 IteratorT const& last_
0060 ) const
0061 {
0062 typedef typename T::value_type value_type;
0063 value_type value(first_,last_);
0064
0065 ref_.push_front( value );
0066 }
0067 };
0068
0069 template<typename T>
0070 inline ref_value_actor<T,push_front_action> push_front_a(T& ref_)
0071 {
0072 return ref_value_actor<T,push_front_action>(ref_);
0073 }
0074
0075 template<
0076 typename T,
0077 typename ValueT
0078 >
0079 inline ref_const_ref_actor<T,ValueT,push_front_action> push_front_a(
0080 T& ref_,
0081 ValueT const& value_
0082 )
0083 {
0084 return ref_const_ref_actor<T,ValueT,push_front_action>(ref_,value_);
0085 }
0086
0087 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0088
0089 }}
0090
0091 #endif