GeezerVison is showing github.com — Use std type_traits instead of boost type_traits · arrowd/python@142661d
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: include/boost/python/arg_from_python.hpp +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | # include <boost/python/converter/arg_from_python.hpp> | 10 | 10 | # if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ | 11 | 11 | || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800)) | 12 | | -# include <boost/type_traits/remove_cv.hpp> | | 12 | +# include <boost/python/detail/type_traits.hpp> | 13 | 13 | #endif | 14 | 14 |
| 15 | 15 | namespace boost { namespace python { | @@ -19,7 +19,7 @@ struct arg_from_python | 19 | 19 | : converter::select_arg_from_python< | 20 | 20 | # if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ | 21 | 21 | || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800)) | 22 | | - typename boost::remove_cv<T>::type | | 22 | + typename detail::remove_cv<T>::type | 23 | 23 | # else | 24 | 24 | T | 25 | 25 | # endif | @@ -28,7 +28,7 @@ struct arg_from_python | 28 | 28 | typedef typename converter::select_arg_from_python< | 29 | 29 | # if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ | 30 | 30 | || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800)) | 31 | | - typename boost::remove_cv<T>::type | | 31 | + typename detail::remove_cv<T>::type | 32 | 32 | # else | 33 | 33 | T | 34 | 34 | # endif | |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/args.hpp +4-7Lines changed: 4 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 11 | 11 | # include <boost/config.hpp> | 12 | 12 | # include <boost/python/detail/preprocessor.hpp> | 13 | 13 | # include <boost/python/detail/type_list.hpp> | 14 | | - | 15 | | -# include <boost/type_traits/is_reference.hpp> | 16 | | -# include <boost/type_traits/remove_reference.hpp> | 17 | | -# include <boost/type_traits/remove_cv.hpp> | | 14 | +# include <boost/python/detail/type_traits.hpp> | 18 | 15 |
| 19 | 16 | # include <boost/preprocessor/enum_params.hpp> | 20 | 17 | # include <boost/preprocessor/repeat.hpp> | @@ -116,9 +113,9 @@ namespace detail | 116 | 113 | template <class T> | 117 | 114 | struct is_reference_to_keywords | 118 | 115 | { | 119 | | - BOOST_STATIC_CONSTANT(bool, is_ref = is_reference<T>::value); | 120 | | - typedef typename remove_reference<T>::type deref; | 121 | | - typedef typename remove_cv<deref>::type key_t; | | 116 | + BOOST_STATIC_CONSTANT(bool, is_ref = detail::is_reference<T>::value); | | 117 | + typedef typename detail::remove_reference<T>::type deref; | | 118 | + typedef typename detail::remove_cv<deref>::type key_t; | 122 | 119 | BOOST_STATIC_CONSTANT(bool, is_key = is_keywords<key_t>::value); | 123 | 120 | BOOST_STATIC_CONSTANT(bool, value = (is_ref & is_key)); | 124 | 121 |
| |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/bases.hpp +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | # define BASES_DWA2002321_HPP | 7 | 7 |
| 8 | 8 | # include <boost/python/detail/prefix.hpp> | 9 | | -# include <boost/type_traits/object_traits.hpp> | 10 | 9 | # include <boost/python/detail/type_list.hpp> | | 10 | +# include <boost/python/detail/type_traits.hpp> | 11 | 11 | # include <boost/mpl/if.hpp> | 12 | 12 | # include <boost/mpl/bool.hpp> | 13 | 13 | # include <boost/preprocessor/enum_params_with_a_default.hpp> | |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/cast.hpp +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | # define CAST_DWA200269_HPP | 7 | 7 |
| 8 | 8 | # include <boost/python/detail/prefix.hpp> | | 9 | +# include <boost/python/detail/type_traits.hpp> | 9 | 10 |
| 10 | | -# include <boost/type_traits/same_traits.hpp> | 11 | | -# include <boost/type_traits/cv_traits.hpp> | 12 | 11 | # include <boost/type.hpp> | 13 | 12 | # include <boost/python/base_type_traits.hpp> | 14 | 13 | # include <boost/python/detail/convertible.hpp> | @@ -76,9 +75,9 @@ namespace detail | 76 | 75 | template <class Source, class Target> | 77 | 76 | inline Target* upcast_impl(Source* x, Target*) | 78 | 77 | { | 79 | | - typedef typename add_cv<Source>::type src_t; | 80 | | - typedef typename add_cv<Target>::type target_t; | 81 | | - bool const same = is_same<src_t,target_t>::value; | | 78 | + typedef typename detail::add_cv<Source>::type src_t; | | 79 | + typedef typename detail::add_cv<Target>::type target_t; | | 80 | + bool const same = detail::is_same<src_t,target_t>::value; | 82 | 81 |
| 83 | 82 | return detail::upcaster<same>::execute(x, (Target*)0); | 84 | 83 | } | |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/class.hpp +6-10Lines changed: 6 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 28 | 28 | # include <boost/python/detail/operator_id.hpp> | 29 | 29 | # include <boost/python/detail/def_helper.hpp> | 30 | 30 | # include <boost/python/detail/force_instantiate.hpp> | | 31 | +# include <boost/python/detail/type_traits.hpp> | 31 | 32 | # include <boost/python/detail/unwrap_type_id.hpp> | 32 | 33 | # include <boost/python/detail/unwrap_wrapper.hpp> | 33 | 34 |
| 34 | | -# include <boost/type_traits/is_same.hpp> | 35 | | -# include <boost/type_traits/is_member_function_pointer.hpp> | 36 | | -# include <boost/type_traits/is_polymorphic.hpp> | 37 | | - | 38 | 35 | # include <boost/mpl/size.hpp> | 39 | 36 | # include <boost/mpl/for_each.hpp> | 40 | 37 | # include <boost/mpl/bool.hpp> | | 53 | 50 |
| 54 | 51 | # ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING | 55 | 52 | # include <boost/mpl/and.hpp> | 56 | | -# include <boost/type_traits/is_member_pointer.hpp> | 57 | 53 | # endif | 58 | 54 |
| 59 | 55 | namespace boost { namespace python { | @@ -84,8 +80,8 @@ namespace detail | 84 | 80 | template <class T> | 85 | 81 | struct is_data_member_pointer | 86 | 82 | : mpl::and_< | 87 | | - is_member_pointer<T> | 88 | | - , mpl::not_<is_member_function_pointer<T> > | | 83 | + detail::is_member_pointer<T> | | 84 | + , mpl::not_<detail::is_member_function_pointer<T> > | 89 | 85 | > | 90 | 86 | {}; | 91 | 87 |
| @@ -138,11 +134,11 @@ namespace detail | 138 | 134 | must_be_derived_class_member(Default const&) | 139 | 135 | { | 140 | 136 | // https://svn.boost.org/trac/boost/ticket/5803 | 141 | | - //typedef typename assertion<mpl::not_<is_same<Default,Fn> > >::failed test0; | | 137 | + //typedef typename assertion<mpl::not_<detail::is_same<Default,Fn> > >::failed test0; | 142 | 138 | # if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) | 143 | | - typedef typename assertion<is_polymorphic<T> >::failed test1 BOOST_ATTRIBUTE_UNUSED; | | 139 | + typedef typename assertion<detail::is_polymorphic<T> >::failed test1 BOOST_ATTRIBUTE_UNUSED; | 144 | 140 | # endif | 145 | | - typedef typename assertion<is_member_function_pointer<Fn> >::failed test2 BOOST_ATTRIBUTE_UNUSED; | | 141 | + typedef typename assertion<detail::is_member_function_pointer<Fn> >::failed test2 BOOST_ATTRIBUTE_UNUSED; | 146 | 142 | not_a_derived_class_member<Default>(Fn()); | 147 | 143 | } | 148 | 144 | }; | |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/converter/arg_from_python.hpp +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | # include <boost/python/detail/prefix.hpp> | 9 | 9 | # include <boost/python/converter/from_python.hpp> | 10 | 10 | # include <boost/python/detail/indirect_traits.hpp> | 11 | | -# include <boost/type_traits/transform_traits.hpp> | 12 | | -# include <boost/type_traits/cv_traits.hpp> | | 11 | +# include <boost/python/detail/type_traits.hpp> | 13 | 12 | # include <boost/python/converter/rvalue_from_python_data.hpp> | 14 | 13 | # include <boost/mpl/eval_if.hpp> | 15 | 14 | # include <boost/mpl/if.hpp> | @@ -106,7 +105,7 @@ struct reference_arg_from_python : arg_lvalue_from_python_base | 106 | 105 | template <class T> | 107 | 106 | struct arg_rvalue_from_python | 108 | 107 | { | 109 | | - typedef typename boost::add_reference< | | 108 | + typedef typename boost::python::detail::add_lvalue_reference< | 110 | 109 | T | 111 | 110 | // We can't add_const here, or it would be impossible to pass | 112 | 111 | // auto_ptr<U> args from Python to C++ | |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/converter/arg_to_python.hpp +4-8Lines changed: 4 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 | # include <boost/python/detail/convertible.hpp> | 25 | 25 | # include <boost/python/detail/string_literal.hpp> | 26 | 26 | # include <boost/python/detail/value_is_shared_ptr.hpp> | 27 | | - | 28 | | -# include <boost/type_traits/cv_traits.hpp> | 29 | | -# include <boost/type_traits/composite_traits.hpp> | 30 | | -# include <boost/type_traits/function_traits.hpp> | 31 | | - | | 27 | +# include <boost/python/detail/type_traits.hpp> | 32 | 28 |
| 33 | 29 | # include <boost/mpl/or.hpp> | 34 | 30 |
| @@ -116,9 +112,9 @@ namespace detail | 116 | 112 |
| 117 | 113 | , typename mpl::if_< | 118 | 114 | mpl::or_< | 119 | | - is_function<T> | | 115 | + boost::python::detail::is_function<T> | 120 | 116 | , indirect_traits::is_pointer_to_function<T> | 121 | | - , is_member_function_pointer<T> | | 117 | + , boost::python::detail::is_member_function_pointer<T> | 122 | 118 | > | 123 | 119 | , function_arg_to_python<T> | 124 | 120 |
| @@ -127,7 +123,7 @@ namespace detail | 127 | 123 | , object_manager_arg_to_python<T> | 128 | 124 |
| 129 | 125 | , typename mpl::if_< | 130 | | - is_pointer<T> | | 126 | + boost::python::detail::is_pointer<T> | 131 | 127 | , pointer_deep_arg_to_python<T> | 132 | 128 |
| 133 | 129 | , typename mpl::if_< | |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/converter/object_manager.hpp +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | # include <boost/python/handle.hpp> | 9 | 9 | # include <boost/python/cast.hpp> | 10 | 10 | # include <boost/python/converter/pyobject_traits.hpp> | 11 | | -# include <boost/type_traits/object_traits.hpp> | | 11 | +# include <boost/python/detail/type_traits.hpp> | 12 | 12 | # include <boost/mpl/if.hpp> | 13 | 13 | # include <boost/python/detail/indirect_traits.hpp> | 14 | 14 | # include <boost/mpl/bool.hpp> | |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/converter/pointer_type_id.hpp +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | # define POINTER_TYPE_ID_DWA2002222_HPP | 7 | 7 |
| 8 | 8 | # include <boost/python/type_id.hpp> | 9 | | -# include <boost/type_traits/composite_traits.hpp> | | 9 | +# include <boost/python/detail/type_traits.hpp> | 10 | 10 |
| 11 | 11 | namespace boost { namespace python { namespace converter { | 12 | 12 |
| @@ -59,7 +59,7 @@ template <class T> | 59 | 59 | type_info pointer_type_id(T(*)() = 0) | 60 | 60 | { | 61 | 61 | return detail::pointer_typeid_select< | 62 | | - is_reference<T>::value | | 62 | + boost::python::detail::is_lvalue_reference<T>::value | 63 | 63 | >::execute((T(*)())0); | 64 | 64 | } | 65 | 65 |
| |
Collapse file Copy file name to clipboardExpand all lines: include/boost/python/converter/pytype_function.hpp +5-4Lines changed: 5 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | # include <boost/python/detail/prefix.hpp> | 9 | 9 | # include <boost/python/converter/registered.hpp> | 10 | 10 | # include <boost/python/detail/unwind_type.hpp> | | 11 | +# include <boost/python/detail/type_traits.hpp> | 11 | 12 |
| 12 | 13 |
| 13 | 14 | namespace boost { namespace python { | @@ -53,7 +54,7 @@ inline python::type_info unwind_type_id_(boost::type<void>* = 0, mpl::true_* =0) | 53 | 54 | template <class T> | 54 | 55 | inline python::type_info unwind_type_id(boost::type<T>* p= 0) | 55 | 56 | { | 56 | | - return unwind_type_id_(p, (mpl::bool_<boost::is_void<T>::value >*)0 ); | | 57 | + return unwind_type_id_(p, (mpl::bool_<boost::python::detail::is_void<T>::value >*)0 ); | 57 | 58 | } | 58 | 59 | } | 59 | 60 |
| @@ -64,7 +65,7 @@ struct expected_pytype_for_arg | 64 | 65 | static PyTypeObject const *get_pytype() | 65 | 66 | { | 66 | 67 | const converter::registration *r=converter::registry::query( | 67 | | - detail::unwind_type_id_((boost::type<T>*)0, (mpl::bool_<boost::is_void<T>::value >*)0 ) | | 68 | + detail::unwind_type_id_((boost::type<T>*)0, (mpl::bool_<boost::python::detail::is_void<T>::value >*)0 ) | 68 | 69 | ); | 69 | 70 | return r ? r->expected_from_python_type(): 0; | 70 | 71 | } | @@ -77,7 +78,7 @@ struct registered_pytype | 77 | 78 | static PyTypeObject const *get_pytype() | 78 | 79 | { | 79 | 80 | const converter::registration *r=converter::registry::query( | 80 | | - detail::unwind_type_id_((boost::type<T>*) 0, (mpl::bool_<boost::is_void<T>::value >*)0 ) | | 81 | + detail::unwind_type_id_((boost::type<T>*) 0, (mpl::bool_<boost::python::detail::is_void<T>::value >*)0 ) | 81 | 82 | ); | 82 | 83 | return r ? r->m_class_object: 0; | 83 | 84 | } | @@ -111,7 +112,7 @@ struct to_python_target_type | 111 | 112 | static PyTypeObject const *get_pytype() | 112 | 113 | { | 113 | 114 | const converter::registration *r=converter::registry::query( | 114 | | - detail::unwind_type_id_((boost::type<T>*)0, (mpl::bool_<boost::is_void<T>::value >*)0 ) | | 115 | + detail::unwind_type_id_((boost::type<T>*)0, (mpl::bool_<boost::python::detail::is_void<T>::value >*)0 ) | 115 | 116 | ); | 116 | 117 | return r ? r->to_python_target_type(): 0; | 117 | 118 | } | |
|