File indexing completed on 2025-02-27 09:54:58
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_SPIRIT_ACTOR_ERASE_ACTOR_HPP
0009 #define BOOST_SPIRIT_ACTOR_ERASE_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 struct erase_action
0041 {
0042 template<
0043 typename T,
0044 typename KeyT
0045 >
0046 void act(T& ref_, KeyT const& key_) const
0047 {
0048 ref_.erase(key_);
0049 }
0050 template<
0051 typename T,
0052 typename IteratorT
0053 >
0054 void act(
0055 T& ref_,
0056 IteratorT const& first_,
0057 IteratorT const& last_
0058 ) const
0059 {
0060 typedef typename T::key_type key_type;
0061 key_type key(first_,last_);
0062
0063 ref_.erase(key);
0064 }
0065 };
0066
0067 template<typename T>
0068 inline ref_value_actor<T,erase_action> erase_a(T& ref_)
0069 {
0070 return ref_value_actor<T,erase_action>(ref_);
0071 }
0072
0073 template<
0074 typename T,
0075 typename KeyT
0076 >
0077 inline ref_const_ref_actor<T,KeyT,erase_action> erase_a(
0078 T& ref_,
0079 KeyT const& key_
0080 )
0081 {
0082 return ref_const_ref_actor<T,KeyT,erase_action>(ref_,key_);
0083 }
0084
0085 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0086
0087 }}
0088
0089 #endif