2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00

Changes to support MSVC 6.0.

[SVN r22430]
This commit is contained in:
Jonathan Brandmeyer
2004-03-04 16:42:56 +00:00
parent 115f9f0644
commit 476cba228d
3 changed files with 20 additions and 10 deletions

View File

@@ -18,22 +18,26 @@ namespace boost { namespace python {
class slice : public object
{
private:
// Helper function to work around bugs in MSVC 6
BOOST_PYTHON_DECL
static object new_slice(PyObject*, PyObject*, PyObject*);
public:
// Equivalent to slice(::)
BOOST_PYTHON_DECL
slice();
// Each argument must be int, slice_nil, or implicitly convertable to int
template<typename Integer1, typename Integer2>
slice( Integer1 start, Integer2 stop)
: object( boost::python::detail::new_reference(
PySlice_New( object(start).ptr(), object(stop).ptr(), NULL)))
: object( new_slice( object(start).ptr(), object(stop).ptr(), NULL))
{}
template<typename Integer1, typename Integer2, typename Integer3>
slice( Integer1 start, Integer2 stop, Integer3 stride)
: object( boost::python::detail::new_reference(
PySlice_New( object(start).ptr(), object(stop).ptr(),
object(stride).ptr())))
: object(
new_slice( object(start).ptr(), object(stop).ptr(), object(stride).ptr()))
{}
// Get the Python objects associated with the slice. In principle, these