Skip to content

Commit 44ba088

Browse files
committed
Fix problem with [:] slices on python::objects
[SVN r21472]
1 parent 08d3798 commit 44ba088

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

include/boost/python/object_core.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ namespace api
146146
const_object_slice slice(object_cref, slice_nil) const;
147147
object_slice slice(object_cref, slice_nil);
148148

149+
const_object_slice slice(slice_nil, slice_nil) const;
150+
object_slice slice(slice_nil, slice_nil);
151+
149152
template <class T, class V>
150153
const_object_slice
151154
slice(T const& start, V const& end) const

include/boost/python/object_slices.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ object_operators<U>::slice(slice_nil, object_cref finish) const
6363
return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr())));
6464
}
6565

66+
template <class U>
67+
object_slice
68+
object_operators<U>::slice(slice_nil, slice_nil)
69+
{
70+
object_cref2 x = *static_cast<U*>(this);
71+
return object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
72+
}
73+
74+
template <class U>
75+
const_object_slice
76+
object_operators<U>::slice(slice_nil, slice_nil) const
77+
{
78+
object_cref2 x = *static_cast<U const*>(this);
79+
return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
80+
}
81+
6682
template <class U>
6783
object_slice
6884
object_operators<U>::slice(object_cref start, slice_nil)

0 commit comments

Comments
 (0)