First public contribution.
1 // Copyright David Abrahams 2002.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef TUPLE_20020706_HPP
6 #define TUPLE_20020706_HPP
8 # include <boost/python/detail/prefix.hpp>
10 #include <boost/python/object.hpp>
11 #include <boost/python/converter/pytype_object_mgr_traits.hpp>
12 #include <boost/preprocessor/enum_params.hpp>
13 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
15 namespace boost { namespace python {
19 struct BOOST_PYTHON_DECL tuple_base : object
23 tuple_base(object_cref sequence);
25 BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple_base, object)
28 static detail::new_reference call(object const&);
32 class tuple : public detail::tuple_base
34 typedef detail::tuple_base base;
39 explicit tuple(T const& sequence)
40 : base(object(sequence))
44 public: // implementation detail -- for internal use only
45 BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple, base)
49 // Converter Specializations // $$$ JDG $$$ moved here to prevent
50 // // G++ bug complaining specialization
51 // provided after instantiation
55 struct object_manager_traits<tuple>
56 : pytype_object_manager_traits<&PyTuple_Type,tuple>
62 inline tuple make_tuple() { return tuple(); }
64 # define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/make_tuple.hpp>))
65 # include BOOST_PP_ITERATE()
67 }} // namespace boost::python