Skip to content

Commit 752effc

Browse files
committed
Remove dependency on Boost.TypeTraits.
1 parent 7374fb0 commit 752effc

19 files changed

Lines changed: 52 additions & 41 deletions

File tree

build.jam

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ constant boost_dependencies :
3939
/boost/throw_exception//boost_throw_exception
4040
/boost/tokenizer//boost_tokenizer
4141
/boost/tuple//boost_tuple
42-
/boost/type_traits//boost_type_traits
4342
/boost/variant//boost_variant
4443
/boost/variant2//boost_variant2 ;
4544

doc/src/docutils/tools/support_status/support_status.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#include <iostream>
1515
#include <fstream>
1616
#include <sstream>
17+
#include <type_traits>
1718

1819
#include <boost/mpl/for_each.hpp>
1920
#include <boost/mpl/vector.hpp>
20-
#include <boost/type_traits/is_base_of.hpp>
2121

2222
#define BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD true
2323

@@ -112,7 +112,7 @@ struct do_unary_test
112112

113113
void operator()()
114114
{
115-
if (boost::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G> >::type::value)
115+
if (std::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G> >::type::value)
116116
{
117117
m_outputter.nyi();
118118
}
@@ -134,7 +134,7 @@ struct do_binary_test
134134
template <typename G1>
135135
void operator()(G1)
136136
{
137-
if (boost::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G1, G2> >::type::value)
137+
if (std::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G1, G2> >::type::value)
138138
{
139139
m_outputter.nyi();
140140
}

doc/src/examples/core/ring_type.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <iostream>
1414
#include <typeinfo>
15+
#include <type_traits>
1516

1617
#include <boost/geometry.hpp>
1718
#include <boost/geometry/geometries/polygon.hpp>
@@ -36,7 +37,7 @@ int main()
3637

3738
std::cout
3839
<< std::boolalpha
39-
<< boost::is_same<ring_type, int_ring_type>::value
40+
<< std::is_same<ring_type, int_ring_type>::value
4041
<< std::endl;
4142

4243
return 0;

doc/src/examples/core/rings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Also shows the related ring_type and interior_type.
1515
*/
1616

1717
#include <iostream>
18+
#include <type_traits>
1819

1920
#include <boost/geometry.hpp>
2021
#include <boost/geometry/geometries/polygon.hpp>
@@ -59,7 +60,7 @@ int main()
5960

6061
std::cout
6162
<< std::boolalpha
62-
<< boost::is_same<ring_type, int_ring_type>::value
63+
<< std::is_same<ring_type, int_ring_type>::value
6364
<< std::endl;
6465

6566
return 0;

example/c08_custom_non_std_example.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Custom polygon example
1212

1313
#include <iostream>
14+
#include <type_traits>
1415

1516
#include <boost/assert.hpp>
1617

@@ -74,7 +75,7 @@ struct custom_iterator : public boost::iterator_facade
7475
boost::random_access_traversal_tag,
7576
typename boost::mpl::if_
7677
<
77-
boost::is_const<MyPolygon>,
78+
std::is_const<MyPolygon>,
7879
my_point const,
7980
my_point
8081
>::type&
@@ -101,7 +102,7 @@ struct custom_iterator : public boost::iterator_facade
101102

102103
typedef typename boost::mpl::if_
103104
<
104-
boost::is_const<MyPolygon>,
105+
std::is_const<MyPolygon>,
105106
my_point const,
106107
my_point
107108
>::type my_point_type;

include/boost/geometry/geometries/adapted/boost_fusion.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include <boost/mpl/pop_front.hpp>
3535
#include <boost/mpl/size.hpp>
3636

37-
#include <boost/type_traits/is_same.hpp>
38-
3937
#include <boost/geometry/core/access.hpp>
4038
#include <boost/geometry/core/coordinate_dimension.hpp>
4139
#include <boost/geometry/core/coordinate_system.hpp>
@@ -57,7 +55,7 @@ struct all_same :
5755
bool,
5856
boost::mpl::count_if<
5957
Sequence,
60-
boost::is_same<
58+
std::is_same<
6159
typename boost::mpl::front<Sequence>::type,
6260
boost::mpl::_
6361
>

include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// boost::polygon::polygon_with_holes_data -> boost::geometry::polygon
1919
// pair{begin_points, end_points} -> ring_proxy
2020

21+
#include <type_traits>
22+
2123
#include <boost/polygon/polygon.hpp>
2224
#include <boost/range/const_iterator.hpp>
2325
#include <boost/range/mutable_iterator.hpp>
@@ -80,15 +82,15 @@ class ring_proxy
8082
public :
8183
typedef typename boost::polygon::polygon_traits
8284
<
83-
typename boost::remove_const<Polygon>::type
85+
typename std::remove_const<Polygon>::type
8486
>::iterator_type iterator_type;
8587

8688
typedef typename boost::polygon::polygon_with_holes_traits
8789
<
88-
typename boost::remove_const<Polygon>::type
90+
typename std::remove_const<Polygon>::type
8991
>::iterator_holes_type hole_iterator_type;
9092

91-
static const bool is_mutable = !boost::is_const<Polygon>::type::value;
93+
static const bool is_mutable = !std::is_const<Polygon>::value;
9294

9395
inline ring_proxy(Polygon& p)
9496
: m_polygon_pointer(&p)

include/boost/geometry/index/detail/serialization.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
#include <memory>
1818

19-
#include <boost/type_traits/alignment_of.hpp>
20-
#include <boost/type_traits/aligned_storage.hpp>
21-
2219
#include <boost/serialization/serialization.hpp>
2320
#include <boost/serialization/split_member.hpp>
2421
#include <boost/serialization/version.hpp>
@@ -67,10 +64,10 @@ class serialization_storage
6764
}
6865
T * address()
6966
{
70-
return static_cast<T*>(m_storage.address());
67+
return reinterpret_cast<T*>(&m_storage);
7168
}
7269
private:
73-
boost::aligned_storage<sizeof(T), boost::alignment_of<T>::value> m_storage;
70+
alignas(T) unsigned char m_storage[sizeof(T)];
7471
};
7572

7673
// TODO - save and load item_version? see: collections_load_imp and collections_save_imp

include/boost/geometry/srs/projections/str_cast.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
#ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP
1212
#define BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP
1313

14+
#include <type_traits>
15+
1416
#include <boost/config.hpp>
1517
#include <boost/geometry/core/exception.hpp>
1618
#include <boost/throw_exception.hpp>
17-
#include <boost/type_traits/remove_cv.hpp>
1819

1920
namespace boost { namespace geometry
2021
{
@@ -116,7 +117,7 @@ struct str_cast_traits_generic
116117
char * str_end = (char*)(void*)str;
117118
T res = str_cast_traits_strtox
118119
<
119-
typename boost::remove_cv<T>::type
120+
typename std::remove_cv<T>::type
120121
>::apply(str, &str_end);
121122
if (str_end == str)
122123
{

index/test/rtree/rtree_values.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// http://www.boost.org/LICENSE_1_0.txt)
99

1010
#include <memory>
11+
#include <type_traits>
1112

1213
#include <rtree/test_rtree.hpp>
1314

@@ -27,16 +28,16 @@ void check_convertible_to_value(Rtree const& rt, Convertible const& conv)
2728
{
2829
static const bool
2930
is_conv_to_indexable
30-
= boost::is_convertible<Convertible, typename Rtree::indexable_type>::value;
31+
= std::is_convertible<Convertible, typename Rtree::indexable_type>::value;
3132
static const bool
3233
is_conv_to_value
33-
= boost::is_convertible<Convertible, typename Rtree::value_type>::value;
34+
= std::is_convertible<Convertible, typename Rtree::value_type>::value;
3435
static const bool
3536
is_same_as_indexable
36-
= boost::is_same<Convertible, typename Rtree::indexable_type>::value;
37+
= std::is_same<Convertible, typename Rtree::indexable_type>::value;
3738
static const bool
3839
is_same_as_value
39-
= boost::is_same<Convertible, typename Rtree::value_type>::value;
40+
= std::is_same<Convertible, typename Rtree::value_type>::value;
4041

4142
BOOST_CHECK_EQUAL(is_same_as_indexable, false);
4243
BOOST_CHECK_EQUAL(is_same_as_value, false);
@@ -52,7 +53,7 @@ void test_pair()
5253
{
5354
typedef std::pair<Box, std::size_t> Value;
5455

55-
typename boost::remove_const<Box>::type box;
56+
typename std::remove_const<Box>::type box;
5657
bg::assign_zero(box);
5758

5859
Value val(box, 0);
@@ -93,7 +94,7 @@ void test_pair_geom_ptr()
9394

9495
typedef std::pair<Box, polygon_t*> Value;
9596

96-
typename boost::remove_const<Box>::type box;
97+
typename std::remove_const<Box>::type box;
9798
bg::assign_zero(box);
9899

99100
polygon_t poly;

0 commit comments

Comments
 (0)