From 44ba088cb4b6ba7f41bd4ee7b52db661e2bea648 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 4 Jan 2004 13:41:00 +0000 Subject: [PATCH] Fix problem with [:] slices on python::objects [SVN r21472] --- include/boost/python/object_core.hpp | 3 +++ include/boost/python/object_slices.hpp | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/boost/python/object_core.hpp b/include/boost/python/object_core.hpp index eb59c52c..667fe4d9 100755 --- a/include/boost/python/object_core.hpp +++ b/include/boost/python/object_core.hpp @@ -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 const_object_slice slice(T const& start, V const& end) const diff --git a/include/boost/python/object_slices.hpp b/include/boost/python/object_slices.hpp index 9a3c747b..1240fb33 100644 --- a/include/boost/python/object_slices.hpp +++ b/include/boost/python/object_slices.hpp @@ -63,6 +63,22 @@ object_operators::slice(slice_nil, object_cref finish) const return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr()))); } +template +object_slice +object_operators::slice(slice_nil, slice_nil) +{ + object_cref2 x = *static_cast(this); + return object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0))); +} + +template +const_object_slice +object_operators::slice(slice_nil, slice_nil) const +{ + object_cref2 x = *static_cast(this); + return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0))); +} + template object_slice object_operators::slice(object_cref start, slice_nil)