Skip to content

Commit f2abcf1

Browse files
committed
Remove uses of boost::enable_if_
1 parent 1361171 commit f2abcf1

File tree

6 files changed

+44
-43
lines changed

6 files changed

+44
-43
lines changed

include/boost/smart_ptr/allocate_local_shared_array.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Distributed under the Boost Software License, Version 1.0.
1010

1111
#include <boost/smart_ptr/allocate_shared_array.hpp>
1212
#include <boost/smart_ptr/local_shared_ptr.hpp>
13+
#include <type_traits>
1314

1415
namespace boost {
1516
namespace detail {
@@ -69,7 +70,7 @@ class lsp_size_array_state
6970
} /* detail */
7071

7172
template<class T, class A>
72-
inline typename enable_if_<is_unbounded_array<T>::value,
73+
inline typename std::enable_if<is_unbounded_array<T>::value,
7374
local_shared_ptr<T> >::type
7475
allocate_local_shared(const A& allocator, std::size_t count)
7576
{
@@ -89,7 +90,7 @@ allocate_local_shared(const A& allocator, std::size_t count)
8990
}
9091

9192
template<class T, class A>
92-
inline typename enable_if_<is_bounded_array<T>::value,
93+
inline typename std::enable_if<is_bounded_array<T>::value,
9394
local_shared_ptr<T> >::type
9495
allocate_local_shared(const A& allocator)
9596
{
@@ -112,7 +113,7 @@ allocate_local_shared(const A& allocator)
112113
}
113114

114115
template<class T, class A>
115-
inline typename enable_if_<is_unbounded_array<T>::value,
116+
inline typename std::enable_if<is_unbounded_array<T>::value,
116117
local_shared_ptr<T> >::type
117118
allocate_local_shared(const A& allocator, std::size_t count,
118119
const typename remove_extent<T>::type& value)
@@ -133,7 +134,7 @@ allocate_local_shared(const A& allocator, std::size_t count,
133134
}
134135

135136
template<class T, class A>
136-
inline typename enable_if_<is_bounded_array<T>::value,
137+
inline typename std::enable_if<is_bounded_array<T>::value,
137138
local_shared_ptr<T> >::type
138139
allocate_local_shared(const A& allocator,
139140
const typename remove_extent<T>::type& value)
@@ -157,7 +158,7 @@ allocate_local_shared(const A& allocator,
157158
}
158159

159160
template<class T, class A>
160-
inline typename enable_if_<is_unbounded_array<T>::value,
161+
inline typename std::enable_if<is_unbounded_array<T>::value,
161162
local_shared_ptr<T> >::type
162163
allocate_local_shared_noinit(const A& allocator, std::size_t count)
163164
{
@@ -166,7 +167,7 @@ allocate_local_shared_noinit(const A& allocator, std::size_t count)
166167
}
167168

168169
template<class T, class A>
169-
inline typename enable_if_<is_bounded_array<T>::value,
170+
inline typename std::enable_if<is_bounded_array<T>::value,
170171
local_shared_ptr<T> >::type
171172
allocate_local_shared_noinit(const A& allocator)
172173
{

include/boost/smart_ptr/allocate_shared_array.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Distributed under the Boost Software License, Version 1.0.
1212
#include <boost/core/alloc_construct.hpp>
1313
#include <boost/core/first_scalar.hpp>
1414
#include <boost/smart_ptr/shared_ptr.hpp>
15-
#include <boost/type_traits/enable_if.hpp>
1615
#include <boost/type_traits/extent.hpp>
1716
#include <boost/type_traits/is_bounded_array.hpp>
1817
#include <boost/type_traits/is_unbounded_array.hpp>
@@ -258,7 +257,7 @@ struct sp_array_result {
258257
} /* detail */
259258

260259
template<class T, class A>
261-
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
260+
inline typename std::enable_if<is_unbounded_array<T>::value, shared_ptr<T> >::type
262261
allocate_shared(const A& allocator, std::size_t count)
263262
{
264263
typedef typename detail::sp_array_element<T>::type element;
@@ -275,7 +274,7 @@ allocate_shared(const A& allocator, std::size_t count)
275274
}
276275

277276
template<class T, class A>
278-
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
277+
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
279278
allocate_shared(const A& allocator)
280279
{
281280
enum {
@@ -295,7 +294,7 @@ allocate_shared(const A& allocator)
295294
}
296295

297296
template<class T, class A>
298-
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
297+
inline typename std::enable_if<is_unbounded_array<T>::value, shared_ptr<T> >::type
299298
allocate_shared(const A& allocator, std::size_t count,
300299
const typename remove_extent<T>::type& value)
301300
{
@@ -313,7 +312,7 @@ allocate_shared(const A& allocator, std::size_t count,
313312
}
314313

315314
template<class T, class A>
316-
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
315+
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
317316
allocate_shared(const A& allocator,
318317
const typename remove_extent<T>::type& value)
319318
{
@@ -334,14 +333,14 @@ allocate_shared(const A& allocator,
334333
}
335334

336335
template<class T, class A>
337-
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
336+
inline typename std::enable_if<is_unbounded_array<T>::value, shared_ptr<T> >::type
338337
allocate_shared_noinit(const A& allocator, std::size_t count)
339338
{
340339
return boost::allocate_shared<T>(boost::noinit_adapt(allocator), count);
341340
}
342341

343342
template<class T, class A>
344-
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
343+
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
345344
allocate_shared_noinit(const A& allocator)
346345
{
347346
return boost::allocate_shared<T>(boost::noinit_adapt(allocator));

include/boost/smart_ptr/allocate_unique.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Distributed under the Boost Software License, Version 1.0.
1414
#include <boost/core/first_scalar.hpp>
1515
#include <boost/core/noinit_adaptor.hpp>
1616
#include <boost/core/pointer_traits.hpp>
17-
#include <boost/type_traits/enable_if.hpp>
1817
#include <boost/type_traits/extent.hpp>
1918
#include <boost/type_traits/is_array.hpp>
2019
#include <boost/type_traits/is_bounded_array.hpp>
@@ -26,6 +25,7 @@ Distributed under the Boost Software License, Version 1.0.
2625
#include <memory>
2726
#include <utility>
2827
#include <cstddef>
28+
#include <type_traits>
2929

3030
namespace boost {
3131
namespace detail {
@@ -354,7 +354,7 @@ class sp_alloc_make {
354354
} /* detail */
355355

356356
template<class T, class A>
357-
inline typename enable_if_<!is_array<T>::value,
357+
inline typename std::enable_if<!is_array<T>::value,
358358
std::unique_ptr<T, alloc_deleter<T, A> > >::type
359359
allocate_unique(const A& alloc)
360360
{
@@ -364,7 +364,7 @@ allocate_unique(const A& alloc)
364364
}
365365

366366
template<class T, class A, class... Args>
367-
inline typename enable_if_<!is_array<T>::value,
367+
inline typename std::enable_if<!is_array<T>::value,
368368
std::unique_ptr<T, alloc_deleter<T, A> > >::type
369369
allocate_unique(const A& alloc, Args&&... args)
370370
{
@@ -374,7 +374,7 @@ allocate_unique(const A& alloc, Args&&... args)
374374
}
375375

376376
template<class T, class A>
377-
inline typename enable_if_<!is_array<T>::value,
377+
inline typename std::enable_if<!is_array<T>::value,
378378
std::unique_ptr<T, alloc_deleter<T, A> > >::type
379379
allocate_unique(const A& alloc, typename type_identity<T>::type&& value)
380380
{
@@ -384,15 +384,15 @@ allocate_unique(const A& alloc, typename type_identity<T>::type&& value)
384384
}
385385

386386
template<class T, class A>
387-
inline typename enable_if_<!is_array<T>::value,
387+
inline typename std::enable_if<!is_array<T>::value,
388388
std::unique_ptr<T, alloc_deleter<T, noinit_adaptor<A> > > >::type
389389
allocate_unique_noinit(const A& alloc)
390390
{
391391
return boost::allocate_unique<T, noinit_adaptor<A> >(alloc);
392392
}
393393

394394
template<class T, class A>
395-
inline typename enable_if_<is_unbounded_array<T>::value,
395+
inline typename std::enable_if<is_unbounded_array<T>::value,
396396
std::unique_ptr<T, alloc_deleter<T, A> > >::type
397397
allocate_unique(const A& alloc, std::size_t size)
398398
{
@@ -403,7 +403,7 @@ allocate_unique(const A& alloc, std::size_t size)
403403
}
404404

405405
template<class T, class A>
406-
inline typename enable_if_<is_bounded_array<T>::value,
406+
inline typename std::enable_if<is_bounded_array<T>::value,
407407
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
408408
alloc_deleter<T, A> > >::type
409409
allocate_unique(const A& alloc)
@@ -415,15 +415,15 @@ allocate_unique(const A& alloc)
415415
}
416416

417417
template<class T, class A>
418-
inline typename enable_if_<is_unbounded_array<T>::value,
418+
inline typename std::enable_if<is_unbounded_array<T>::value,
419419
std::unique_ptr<T, alloc_deleter<T, noinit_adaptor<A> > > >::type
420420
allocate_unique_noinit(const A& alloc, std::size_t size)
421421
{
422422
return boost::allocate_unique<T, noinit_adaptor<A> >(alloc, size);
423423
}
424424

425425
template<class T, class A>
426-
inline typename enable_if_<is_bounded_array<T>::value,
426+
inline typename std::enable_if<is_bounded_array<T>::value,
427427
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
428428
alloc_deleter<T, noinit_adaptor<A> > > >::type
429429
allocate_unique_noinit(const A& alloc)
@@ -432,7 +432,7 @@ allocate_unique_noinit(const A& alloc)
432432
}
433433

434434
template<class T, class A>
435-
inline typename enable_if_<is_unbounded_array<T>::value,
435+
inline typename std::enable_if<is_unbounded_array<T>::value,
436436
std::unique_ptr<T, alloc_deleter<T, A> > >::type
437437
allocate_unique(const A& alloc, std::size_t size,
438438
const typename remove_extent<T>::type& value)
@@ -445,7 +445,7 @@ allocate_unique(const A& alloc, std::size_t size,
445445
}
446446

447447
template<class T, class A>
448-
inline typename enable_if_<is_bounded_array<T>::value,
448+
inline typename std::enable_if<is_bounded_array<T>::value,
449449
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
450450
alloc_deleter<T, A> > >::type
451451
allocate_unique(const A& alloc,

include/boost/smart_ptr/make_local_shared_array.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ Distributed under the Boost Software License, Version 1.0.
1111

1212
#include <boost/core/default_allocator.hpp>
1313
#include <boost/smart_ptr/allocate_local_shared_array.hpp>
14+
#include <type_traits>
1415

1516
namespace boost {
1617

1718
template<class T>
18-
inline typename enable_if_<is_bounded_array<T>::value,
19+
inline typename std::enable_if<is_bounded_array<T>::value,
1920
local_shared_ptr<T> >::type
2021
make_local_shared()
2122
{
@@ -24,7 +25,7 @@ make_local_shared()
2425
}
2526

2627
template<class T>
27-
inline typename enable_if_<is_bounded_array<T>::value,
28+
inline typename std::enable_if<is_bounded_array<T>::value,
2829
local_shared_ptr<T> >::type
2930
make_local_shared(const typename remove_extent<T>::type& value)
3031
{
@@ -33,7 +34,7 @@ make_local_shared(const typename remove_extent<T>::type& value)
3334
}
3435

3536
template<class T>
36-
inline typename enable_if_<is_unbounded_array<T>::value,
37+
inline typename std::enable_if<is_unbounded_array<T>::value,
3738
local_shared_ptr<T> >::type
3839
make_local_shared(std::size_t size)
3940
{
@@ -42,7 +43,7 @@ make_local_shared(std::size_t size)
4243
}
4344

4445
template<class T>
45-
inline typename enable_if_<is_unbounded_array<T>::value,
46+
inline typename std::enable_if<is_unbounded_array<T>::value,
4647
local_shared_ptr<T> >::type
4748
make_local_shared(std::size_t size,
4849
const typename remove_extent<T>::type& value)
@@ -52,7 +53,7 @@ make_local_shared(std::size_t size,
5253
}
5354

5455
template<class T>
55-
inline typename enable_if_<is_bounded_array<T>::value,
56+
inline typename std::enable_if<is_bounded_array<T>::value,
5657
local_shared_ptr<T> >::type
5758
make_local_shared_noinit()
5859
{
@@ -61,7 +62,7 @@ make_local_shared_noinit()
6162
}
6263

6364
template<class T>
64-
inline typename enable_if_<is_unbounded_array<T>::value,
65+
inline typename std::enable_if<is_unbounded_array<T>::value,
6566
local_shared_ptr<T> >::type
6667
make_local_shared_noinit(std::size_t size)
6768
{

include/boost/smart_ptr/make_shared_array.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,52 @@ Distributed under the Boost Software License, Version 1.0.
1010

1111
#include <boost/core/default_allocator.hpp>
1212
#include <boost/smart_ptr/allocate_shared_array.hpp>
13+
#include <type_traits>
1314

1415
namespace boost {
1516

1617
template<class T>
17-
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
18+
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
1819
make_shared()
1920
{
2021
return boost::allocate_shared<T>(boost::default_allocator<typename
2122
detail::sp_array_element<T>::type>());
2223
}
2324

2425
template<class T>
25-
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
26+
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
2627
make_shared(const typename remove_extent<T>::type& value)
2728
{
2829
return boost::allocate_shared<T>(boost::default_allocator<typename
2930
detail::sp_array_element<T>::type>(), value);
3031
}
3132

3233
template<class T>
33-
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
34+
inline typename std::enable_if<is_unbounded_array<T>::value, shared_ptr<T> >::type
3435
make_shared(std::size_t size)
3536
{
3637
return boost::allocate_shared<T>(boost::default_allocator<typename
3738
detail::sp_array_element<T>::type>(), size);
3839
}
3940

4041
template<class T>
41-
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
42+
inline typename std::enable_if<is_unbounded_array<T>::value, shared_ptr<T> >::type
4243
make_shared(std::size_t size, const typename remove_extent<T>::type& value)
4344
{
4445
return boost::allocate_shared<T>(boost::default_allocator<typename
4546
detail::sp_array_element<T>::type>(), size, value);
4647
}
4748

4849
template<class T>
49-
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
50+
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
5051
make_shared_noinit()
5152
{
5253
return boost::allocate_shared_noinit<T>(boost::default_allocator<typename
5354
detail::sp_array_element<T>::type>());
5455
}
5556

5657
template<class T>
57-
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
58+
inline typename std::enable_if<is_unbounded_array<T>::value, shared_ptr<T> >::type
5859
make_shared_noinit(std::size_t size)
5960
{
6061
return boost::allocate_shared_noinit<T>(boost::default_allocator<typename

0 commit comments

Comments
 (0)