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

Made Tuple constructor from std::size_t explicit. Added 4-arg template constructor.

[SVN r8146]
This commit is contained in:
Dave Abrahams
2000-11-06 05:14:11 +00:00
parent 48c5fd3bf2
commit 6236939512

View File

@@ -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 <class First, class Second>
@@ -63,6 +63,16 @@ class Tuple : public Object
set_item(2, Ptr(to_python(third)));
}
template <class First, class Second, class Third, class Fourth>
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;