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:
12
objects.h
12
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 <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;
|
||||
|
||||
Reference in New Issue
Block a user