1 [section boost/python/tuple.hpp]
3 Exposes a [link concepts.objectwrapper.typewrapper_concept_requirements TypeWrapper] for the Python [@http://www.python.org/doc/current/tut/node7.html#SECTION007300000000000000000`tuple`] type.
5 [section Class `tuple`]
6 Exposes the interface of Python's built-in tuple type. The semantics of the constructors and member functions defined below can be fully understood by reading the [link concepts.objectwrapper.typewrapper_concept_requirements TypeWrapper] concept definition. Since tuple is publicly derived from [link object_wrappers.boost_python_object_hpp.class_object `object`], the public `object` interface applies to `tuple` instances as well.
8 namespace boost { namespace python
10 class tuple : public object
12 // tuple() -> an empty tuple
15 // tuple(sequence) -> tuple initialized from sequence's items
17 explicit tuple(T const& sequence)
22 [section Function `make_tuple`]
24 namespace boost { namespace python
29 tuple make_tuple(A0 const& a0);
31 template <class A0, class A1>
32 tuple make_tuple(A0 const& a0, A1 const& a1);
34 template <class A0, class A1,...class An>
35 tuple make_tuple(A0 const& a0, A1 const& a1,...An const& an);
39 [[Effect][Constructs a new tuple object composed of `object(a0),
40 object(a0),...object(an)`. ]]
45 using namespace boost::python;
46 tuple head_and_tail(object sequence)
48 return make_tuple(sequence[0],sequence[-1]);