From 62369395125b13c17b06b43c05e84bec6928aef6 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 6 Nov 2000 05:14:11 +0000 Subject: [PATCH] Made Tuple constructor from std::size_t explicit. Added 4-arg template constructor. [SVN r8146] --- objects.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/objects.h b/objects.h index 9f15284c..250fe62d 100644 --- a/objects.h +++ b/objects.h @@ -35,7 +35,7 @@ class Object class Tuple : public Object { public: - Tuple(std::size_t n = 0); + explicit Tuple(std::size_t n = 0); explicit Tuple(Ptr p); template @@ -63,6 +63,16 @@ class Tuple : public Object set_item(2, Ptr(to_python(third))); } + template + Tuple(const First& first, const Second& second, const Third& third, const Fourth& fourth) + : Object(Ptr(PyTuple_New(4))) + { + set_item(0, Ptr(to_python(first))); + set_item(1, Ptr(to_python(second))); + set_item(2, Ptr(to_python(third))); + set_item(3, Ptr(to_python(fourth))); + } + static PyTypeObject* type_object(); static bool accepts(Ptr p); std::size_t size() const;