Skip to content

Commit 142661d

Browse files
shreyans800755stefanseefeld
authored andcommitted
Use std type_traits instead of boost type_traits
Fixes boostorg#106
1 parent d6554d6 commit 142661d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+324
-275
lines changed

include/boost/python/arg_from_python.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# include <boost/python/converter/arg_from_python.hpp>
1010
# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
1111
|| 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>
1313
#endif
1414

1515
namespace boost { namespace python {
@@ -19,7 +19,7 @@ struct arg_from_python
1919
: converter::select_arg_from_python<
2020
# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
2121
|| BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800))
22-
typename boost::remove_cv<T>::type
22+
typename detail::remove_cv<T>::type
2323
# else
2424
T
2525
# endif
@@ -28,7 +28,7 @@ struct arg_from_python
2828
typedef typename converter::select_arg_from_python<
2929
# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
3030
|| BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800))
31-
typename boost::remove_cv<T>::type
31+
typename detail::remove_cv<T>::type
3232
# else
3333
T
3434
# endif

include/boost/python/args.hpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
# include <boost/config.hpp>
1212
# include <boost/python/detail/preprocessor.hpp>
1313
# 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>
1815

1916
# include <boost/preprocessor/enum_params.hpp>
2017
# include <boost/preprocessor/repeat.hpp>
@@ -116,9 +113,9 @@ namespace detail
116113
template <class T>
117114
struct is_reference_to_keywords
118115
{
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;
122119
BOOST_STATIC_CONSTANT(bool, is_key = is_keywords<key_t>::value);
123120
BOOST_STATIC_CONSTANT(bool, value = (is_ref & is_key));
124121

include/boost/python/bases.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# define BASES_DWA2002321_HPP
77

88
# include <boost/python/detail/prefix.hpp>
9-
# include <boost/type_traits/object_traits.hpp>
109
# include <boost/python/detail/type_list.hpp>
10+
# include <boost/python/detail/type_traits.hpp>
1111
# include <boost/mpl/if.hpp>
1212
# include <boost/mpl/bool.hpp>
1313
# include <boost/preprocessor/enum_params_with_a_default.hpp>

include/boost/python/cast.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
# define CAST_DWA200269_HPP
77

88
# include <boost/python/detail/prefix.hpp>
9+
# include <boost/python/detail/type_traits.hpp>
910

10-
# include <boost/type_traits/same_traits.hpp>
11-
# include <boost/type_traits/cv_traits.hpp>
1211
# include <boost/type.hpp>
1312
# include <boost/python/base_type_traits.hpp>
1413
# include <boost/python/detail/convertible.hpp>
@@ -76,9 +75,9 @@ namespace detail
7675
template <class Source, class Target>
7776
inline Target* upcast_impl(Source* x, Target*)
7877
{
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;
8281

8382
return detail::upcaster<same>::execute(x, (Target*)0);
8483
}

include/boost/python/class.hpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@
2828
# include <boost/python/detail/operator_id.hpp>
2929
# include <boost/python/detail/def_helper.hpp>
3030
# include <boost/python/detail/force_instantiate.hpp>
31+
# include <boost/python/detail/type_traits.hpp>
3132
# include <boost/python/detail/unwrap_type_id.hpp>
3233
# include <boost/python/detail/unwrap_wrapper.hpp>
3334

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-
3835
# include <boost/mpl/size.hpp>
3936
# include <boost/mpl/for_each.hpp>
4037
# include <boost/mpl/bool.hpp>
@@ -53,7 +50,6 @@
5350

5451
# ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING
5552
# include <boost/mpl/and.hpp>
56-
# include <boost/type_traits/is_member_pointer.hpp>
5753
# endif
5854

5955
namespace boost { namespace python {
@@ -84,8 +80,8 @@ namespace detail
8480
template <class T>
8581
struct is_data_member_pointer
8682
: 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> >
8985
>
9086
{};
9187

@@ -138,11 +134,11 @@ namespace detail
138134
must_be_derived_class_member(Default const&)
139135
{
140136
// 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;
142138
# 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;
144140
# 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;
146142
not_a_derived_class_member<Default>(Fn());
147143
}
148144
};

include/boost/python/converter/arg_from_python.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
# include <boost/python/detail/prefix.hpp>
99
# include <boost/python/converter/from_python.hpp>
1010
# 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>
1312
# include <boost/python/converter/rvalue_from_python_data.hpp>
1413
# include <boost/mpl/eval_if.hpp>
1514
# include <boost/mpl/if.hpp>
@@ -106,7 +105,7 @@ struct reference_arg_from_python : arg_lvalue_from_python_base
106105
template <class T>
107106
struct arg_rvalue_from_python
108107
{
109-
typedef typename boost::add_reference<
108+
typedef typename boost::python::detail::add_lvalue_reference<
110109
T
111110
// We can't add_const here, or it would be impossible to pass
112111
// auto_ptr<U> args from Python to C++

include/boost/python/converter/arg_to_python.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
# include <boost/python/detail/convertible.hpp>
2525
# include <boost/python/detail/string_literal.hpp>
2626
# 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>
3228

3329
# include <boost/mpl/or.hpp>
3430

@@ -116,9 +112,9 @@ namespace detail
116112

117113
, typename mpl::if_<
118114
mpl::or_<
119-
is_function<T>
115+
boost::python::detail::is_function<T>
120116
, indirect_traits::is_pointer_to_function<T>
121-
, is_member_function_pointer<T>
117+
, boost::python::detail::is_member_function_pointer<T>
122118
>
123119
, function_arg_to_python<T>
124120

@@ -127,7 +123,7 @@ namespace detail
127123
, object_manager_arg_to_python<T>
128124

129125
, typename mpl::if_<
130-
is_pointer<T>
126+
boost::python::detail::is_pointer<T>
131127
, pointer_deep_arg_to_python<T>
132128

133129
, typename mpl::if_<

include/boost/python/converter/object_manager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# include <boost/python/handle.hpp>
99
# include <boost/python/cast.hpp>
1010
# include <boost/python/converter/pyobject_traits.hpp>
11-
# include <boost/type_traits/object_traits.hpp>
11+
# include <boost/python/detail/type_traits.hpp>
1212
# include <boost/mpl/if.hpp>
1313
# include <boost/python/detail/indirect_traits.hpp>
1414
# include <boost/mpl/bool.hpp>

include/boost/python/converter/pointer_type_id.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# define POINTER_TYPE_ID_DWA2002222_HPP
77

88
# include <boost/python/type_id.hpp>
9-
# include <boost/type_traits/composite_traits.hpp>
9+
# include <boost/python/detail/type_traits.hpp>
1010

1111
namespace boost { namespace python { namespace converter {
1212

@@ -59,7 +59,7 @@ template <class T>
5959
type_info pointer_type_id(T(*)() = 0)
6060
{
6161
return detail::pointer_typeid_select<
62-
is_reference<T>::value
62+
boost::python::detail::is_lvalue_reference<T>::value
6363
>::execute((T(*)())0);
6464
}
6565

include/boost/python/converter/pytype_function.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# include <boost/python/detail/prefix.hpp>
99
# include <boost/python/converter/registered.hpp>
1010
# include <boost/python/detail/unwind_type.hpp>
11+
# include <boost/python/detail/type_traits.hpp>
1112

1213

1314
namespace boost { namespace python {
@@ -53,7 +54,7 @@ inline python::type_info unwind_type_id_(boost::type<void>* = 0, mpl::true_* =0)
5354
template <class T>
5455
inline python::type_info unwind_type_id(boost::type<T>* p= 0)
5556
{
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 );
5758
}
5859
}
5960

@@ -64,7 +65,7 @@ struct expected_pytype_for_arg
6465
static PyTypeObject const *get_pytype()
6566
{
6667
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 )
6869
);
6970
return r ? r->expected_from_python_type(): 0;
7071
}
@@ -77,7 +78,7 @@ struct registered_pytype
7778
static PyTypeObject const *get_pytype()
7879
{
7980
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 )
8182
);
8283
return r ? r->m_class_object: 0;
8384
}
@@ -111,7 +112,7 @@ struct to_python_target_type
111112
static PyTypeObject const *get_pytype()
112113
{
113114
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 )
115116
);
116117
return r ? r->to_python_target_type(): 0;
117118
}

0 commit comments

Comments
 (0)