@@ -27,6 +27,12 @@ struct slice_policies : const_slice_policies
2727 static void del (object const & target, key_type const & key);
2828};
2929
30+ template <class T , class U >
31+ inline slice_policies::key_type slice_key (T x, U y)
32+ {
33+ return slice_policies::key_type (handle<>(x), handle<>(y));
34+ }
35+
3036//
3137// implementation
3238//
@@ -35,63 +41,63 @@ object_slice
3541object_operators<U>::slice(object_cref start, object_cref finish)
3642{
3743 object_cref2 x = *static_cast <U*>(this );
38- return object_slice (x, std::make_pair (borrowed (start.ptr ()), borrowed (finish.ptr ())));
44+ return object_slice (x, api::slice_key (borrowed (start.ptr ()), borrowed (finish.ptr ())));
3945}
4046
4147template <class U >
4248const_object_slice
4349object_operators<U>::slice(object_cref start, object_cref finish) const
4450{
4551 object_cref2 x = *static_cast <U const *>(this );
46- return const_object_slice (x, std::make_pair (borrowed (start.ptr ()), borrowed (finish.ptr ())));
52+ return const_object_slice (x, api::slice_key (borrowed (start.ptr ()), borrowed (finish.ptr ())));
4753}
4854
4955template <class U >
5056object_slice
5157object_operators<U>::slice(slice_nil, object_cref finish)
5258{
5359 object_cref2 x = *static_cast <U*>(this );
54- return object_slice (x, std::make_pair (allow_null ((PyObject*)0 ), borrowed (finish.ptr ())));
60+ return object_slice (x, api::slice_key (allow_null ((PyObject*)0 ), borrowed (finish.ptr ())));
5561}
5662
5763template <class U >
5864const_object_slice
5965object_operators<U>::slice(slice_nil, object_cref finish) const
6066{
6167 object_cref2 x = *static_cast <U const *>(this );
62- return const_object_slice (x, std::make_pair (allow_null ((PyObject*)0 ), borrowed (finish.ptr ())));
68+ return const_object_slice (x, api::slice_key (allow_null ((PyObject*)0 ), borrowed (finish.ptr ())));
6369}
6470
6571template <class U >
6672object_slice
6773object_operators<U>::slice(slice_nil, slice_nil)
6874{
6975 object_cref2 x = *static_cast <U*>(this );
70- return object_slice (x, std::make_pair (allow_null ((PyObject*)0 ), allow_null ((PyObject*)0 )));
76+ return object_slice (x, api::slice_key (allow_null ((PyObject*)0 ), allow_null ((PyObject*)0 )));
7177}
7278
7379template <class U >
7480const_object_slice
7581object_operators<U>::slice(slice_nil, slice_nil) const
7682{
7783 object_cref2 x = *static_cast <U const *>(this );
78- return const_object_slice (x, std::make_pair (allow_null ((PyObject*)0 ), allow_null ((PyObject*)0 )));
84+ return const_object_slice (x, api::slice_key (allow_null ((PyObject*)0 ), allow_null ((PyObject*)0 )));
7985}
8086
8187template <class U >
8288object_slice
8389object_operators<U>::slice(object_cref start, slice_nil)
8490{
8591 object_cref2 x = *static_cast <U*>(this );
86- return object_slice (x, std::make_pair (borrowed (start.ptr ()), allow_null ((PyObject*)0 )));
92+ return object_slice (x, api::slice_key (borrowed (start.ptr ()), allow_null ((PyObject*)0 )));
8793}
8894
8995template <class U >
9096const_object_slice
9197object_operators<U>::slice(object_cref start, slice_nil) const
9298{
9399 object_cref2 x = *static_cast <U const *>(this );
94- return const_object_slice (x, std::make_pair (borrowed (start.ptr ()), allow_null ((PyObject*)0 )));
100+ return const_object_slice (x, api::slice_key (borrowed (start.ptr ()), allow_null ((PyObject*)0 )));
95101}
96102# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
97103template <class U >
0 commit comments