diff --git a/include/boost/python/args.hpp b/include/boost/python/args.hpp new file mode 100644 index 00000000..b584506b --- /dev/null +++ b/include/boost/python/args.hpp @@ -0,0 +1,19 @@ +// Copyright David Abrahams 2002. Permission to copy, use, +// modify, sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +#ifndef ARGS_DWA2002323_HPP +# define ARGS_DWA2002323_HPP +# include + +namespace boost { namespace python { + +// A type list for specifying arguments +template < BOOST_MPL_LIST_DEFAULT_PARAMETERS(typename A, ::boost::mpl::null_argument) > +struct args : ::boost::mpl::type_list< BOOST_MPL_LIST_PARAMETERS(A) >::type +{}; + +}} // namespace boost::python + +#endif // ARGS_DWA2002323_HPP diff --git a/include/boost/python/bases.hpp b/include/boost/python/bases.hpp new file mode 100644 index 00000000..468c6744 --- /dev/null +++ b/include/boost/python/bases.hpp @@ -0,0 +1,58 @@ +// Copyright David Abrahams 2002. Permission to copy, use, +// modify, sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +#ifndef BASES_DWA2002321_HPP +# define BASES_DWA2002321_HPP +# include +# include +# include +# include + +namespace boost { namespace python { + // A type list for specifying bases + template < BOOST_MPL_LIST_DEFAULT_PARAMETERS(typename B, ::boost::mpl::null_argument) > + struct bases : ::boost::mpl::type_list< BOOST_MPL_LIST_PARAMETERS(B) >::type + {}; + + namespace detail + { +# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + template struct specifies_bases + { + BOOST_STATIC_CONSTANT(bool, value = false); + }; + template < BOOST_MPL_LIST_PARAMETERS(class B) > + struct specifies_bases< bases< BOOST_MPL_LIST_PARAMETERS(B) > > + { + BOOST_STATIC_CONSTANT(bool, value = true); + }; +# else + template < BOOST_MPL_LIST_PARAMETERS(class B) > + static char is_bases_helper(bases< BOOST_MPL_LIST_PARAMETERS(B) > const&); + + static char (& is_bases_helper(...) )[256]; + + template struct specifies_bases + { + private: + static typename add_reference::type make(); + BOOST_STATIC_CONSTANT(bool, non_ref = !is_reference::value); + public: + BOOST_STATIC_CONSTANT(bool, value = non_ref & (sizeof(is_bases_helper(make())) == 1)); + }; +# endif + template > + struct select_bases + : mpl::select_type< + specifies_bases::value + , T + , Prev + > + { + }; + } +}} // namespace boost::python + +#endif // BASES_DWA2002321_HPP