2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 05:22:45 +00:00

Fix problem with [:] slices on python::objects

[SVN r21472]
This commit is contained in:
Dave Abrahams
2004-01-04 13:41:00 +00:00
parent 08d3798722
commit 44ba088cb4
2 changed files with 19 additions and 0 deletions

View File

@@ -146,6 +146,9 @@ namespace api
const_object_slice slice(object_cref, slice_nil) const;
object_slice slice(object_cref, slice_nil);
const_object_slice slice(slice_nil, slice_nil) const;
object_slice slice(slice_nil, slice_nil);
template <class T, class V>
const_object_slice
slice(T const& start, V const& end) const

View File

@@ -63,6 +63,22 @@ object_operators<U>::slice(slice_nil, object_cref finish) const
return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr())));
}
template <class U>
object_slice
object_operators<U>::slice(slice_nil, slice_nil)
{
object_cref2 x = *static_cast<U*>(this);
return object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
}
template <class U>
const_object_slice
object_operators<U>::slice(slice_nil, slice_nil) const
{
object_cref2 x = *static_cast<U const*>(this);
return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
}
template <class U>
object_slice
object_operators<U>::slice(object_cref start, slice_nil)