Update contrib.
1 // Copyright David Abrahams 2002.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef OBJECT_ITEMS_DWA2002615_HPP
6 # define OBJECT_ITEMS_DWA2002615_HPP
8 # include <boost/python/detail/prefix.hpp>
10 # include <boost/python/proxy.hpp>
11 # include <boost/python/object_core.hpp>
12 # include <boost/python/object_protocol.hpp>
14 namespace boost { namespace python { namespace api {
16 struct const_item_policies
18 typedef object key_type;
19 static object get(object const& target, object const& key);
22 struct item_policies : const_item_policies
24 static object const& set(object const& target, object const& key, object const& value);
25 static void del(object const& target, object const& key);
33 object_operators<U>::operator[](object_cref key)
35 object_cref2 x = *static_cast<U*>(this);
36 return object_item(x, key);
40 inline const_object_item
41 object_operators<U>::operator[](object_cref key) const
43 object_cref2 x = *static_cast<U const*>(this);
44 return const_object_item(x, key);
47 # if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
50 inline const_object_item
51 object_operators<U>::operator[](T const& key) const
53 return (*this)[object(key)];
59 object_operators<U>::operator[](T const& key)
61 return (*this)[object(key)];
66 inline object const_item_policies::get(object const& target, object const& key)
68 return getitem(target, key);
71 inline object const& item_policies::set(
74 , object const& value)
76 setitem(target, key, value);
80 inline void item_policies::del(
87 }}} // namespace boost::python::api
89 #endif // OBJECT_ITEMS_DWA2002615_HPP