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_ASSIGN_KEY_ACTOR_HPP
9 #define BOOST_SPIRIT_ACTOR_ASSIGN_KEY_ACTOR_HPP
11 #include <boost/spirit/home/classic/namespace.hpp>
12 #include <boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp>
13 #include <boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp>
15 namespace boost { namespace spirit {
17 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
19 struct assign_key_action
26 void act(T& ref_, ValueT const& value_, KeyT const& key_) const
28 ref_[ key_ ] = value_;
39 IteratorT const& first_,
40 IteratorT const& last_
43 typedef typename T::key_type key_type;
44 key_type key(first_,last_);
54 inline ref_const_ref_value_actor<T,ValueT,assign_key_action>
55 assign_key_a(T& ref_, ValueT const& value_)
57 return ref_const_ref_value_actor<T,ValueT,assign_key_action>(
68 inline ref_const_ref_const_ref_actor<
80 return ref_const_ref_const_ref_actor<
92 BOOST_SPIRIT_CLASSIC_NAMESPACE_END