@@ -63,16 +63,14 @@ template <typename...> struct conjunction : std::true_type {};
63
63
template <typename B1> struct conjunction <B1> : B1 {};
64
64
template <typename B1, typename ... Bn>
65
65
struct conjunction <B1, Bn...>
66
- : std::conditional <bool (B1::value), conjunction<Bn...>, B1>::type {};
66
+ : std::conditional_t <bool (B1::value), conjunction<Bn...>, B1> {};
67
67
68
68
template <typename T> struct make_const_ptr {
69
- using type =
70
- typename std::add_pointer<typename std::add_const<T>::type>::type;
69
+ using type = std::add_pointer_t <std::add_const_t <T>>;
71
70
};
72
71
73
72
template <typename T> struct make_const_ref {
74
- using type = typename std::add_lvalue_reference<
75
- typename std::add_const<T>::type>::type;
73
+ using type = std::add_lvalue_reference_t <std::add_const_t <T>>;
76
74
};
77
75
78
76
// ===----------------------------------------------------------------------===//
@@ -117,7 +115,7 @@ class function_ref<Ret(Params...)> {
117
115
function_ref (Callable &&callable,
118
116
std::enable_if_t <!std::is_same<std::remove_reference_t <Callable>,
119
117
function_ref>::value> * = nullptr )
120
- : callback(callback_fn<typename std::remove_reference <Callable>::type >),
118
+ : callback(callback_fn<std::remove_reference_t <Callable>>),
121
119
callable (reinterpret_cast <intptr_t >(&callable)) {}
122
120
123
121
Ret operator ()(Params ...params) const {
@@ -200,12 +198,12 @@ template <typename T> auto drop_begin(T &&RangeOrContainer, size_t N) {
200
198
201
199
template <typename ItTy, typename FuncTy,
202
200
typename FuncReturnTy =
203
- decltype (std::declval<FuncTy>()(*std::declval<ItTy>()))>
201
+ decltype (std::declval<FuncTy>()(*std::declval<ItTy>()))>
204
202
class mapped_iterator
205
203
: public iterator_adaptor_base<
206
- mapped_iterator<ItTy, FuncTy>, ItTy,
207
- typename std::iterator_traits<ItTy>::iterator_category,
208
- typename std::remove_reference <FuncReturnTy>::type > {
204
+ mapped_iterator<ItTy, FuncTy>, ItTy,
205
+ typename std::iterator_traits<ItTy>::iterator_category,
206
+ std::remove_reference_t <FuncReturnTy>> {
209
207
public:
210
208
mapped_iterator (ItTy U, FuncTy F)
211
209
: mapped_iterator::iterator_adaptor_base (std::move (U)), F (std::move (F)) {}
@@ -247,8 +245,7 @@ template <typename Ty> class has_rbegin_impl {
247
245
248
246
// / Metafunction to determine if T& or T has a member called rbegin().
249
247
template <typename Ty>
250
- struct has_rbegin : has_rbegin_impl<typename std::remove_reference<Ty>::type> {
251
- };
248
+ struct has_rbegin : has_rbegin_impl<std::remove_reference_t <Ty>> {};
252
249
253
250
// Returns an iterator_range over the given container which iterates in reverse.
254
251
// Note that the container must have rbegin()/rend() methods for this to work.
@@ -295,15 +292,14 @@ class filter_iterator_base
295
292
: public iterator_adaptor_base<
296
293
filter_iterator_base<WrappedIteratorT, PredicateT, IterTag>,
297
294
WrappedIteratorT,
298
- typename std::common_type<
299
- IterTag, typename std::iterator_traits<
300
- WrappedIteratorT>::iterator_category>::type > {
295
+ std::common_type_t <IterTag,
296
+ typename std::iterator_traits<
297
+ WrappedIteratorT>::iterator_category>> {
301
298
using BaseT = iterator_adaptor_base<
302
299
filter_iterator_base<WrappedIteratorT, PredicateT, IterTag>,
303
300
WrappedIteratorT,
304
- typename std::common_type<
305
- IterTag, typename std::iterator_traits<
306
- WrappedIteratorT>::iterator_category>::type>;
301
+ std::common_type_t <IterTag, typename std::iterator_traits<
302
+ WrappedIteratorT>::iterator_category>>;
307
303
308
304
protected:
309
305
WrappedIteratorT End;
@@ -521,9 +517,10 @@ template<typename... Iters> struct ZipTupleType {
521
517
522
518
template <typename ZipType, typename ... Iters>
523
519
using zip_traits = iterator_facade_base<
524
- ZipType, typename std::common_type<std::bidirectional_iterator_tag,
525
- typename std::iterator_traits<
526
- Iters>::iterator_category...>::type,
520
+ ZipType,
521
+ std::common_type_t <
522
+ std::bidirectional_iterator_tag,
523
+ typename std::iterator_traits<Iters>::iterator_category...>,
527
524
// ^ TODO: Implement random access methods.
528
525
typename ZipTupleType<Iters...>::type,
529
526
typename std::iterator_traits<typename std::tuple_element<
@@ -675,9 +672,8 @@ static auto deref_or_none(const Iter &I, const Iter &End) -> llvm::Optional<
675
672
}
676
673
677
674
template <typename Iter> struct ZipLongestItemType {
678
- using type =
679
- llvm::Optional<typename std::remove_const<typename std::remove_reference<
680
- decltype (*std::declval<Iter>())>::type>::type>;
675
+ using type = llvm::Optional<std::remove_const_t <
676
+ std::remove_reference_t <decltype (*std::declval<Iter>())>>>;
681
677
};
682
678
683
679
template <typename ... Iters> struct ZipLongestTupleType {
@@ -688,12 +684,12 @@ template <typename... Iters>
688
684
class zip_longest_iterator
689
685
: public iterator_facade_base<
690
686
zip_longest_iterator<Iters...>,
691
- typename std::common_type <
687
+ std::common_type_t <
692
688
std::forward_iterator_tag,
693
- typename std::iterator_traits<Iters>::iterator_category...>::type ,
689
+ typename std::iterator_traits<Iters>::iterator_category...>,
694
690
typename ZipLongestTupleType<Iters...>::type,
695
- typename std::iterator_traits<typename std::tuple_element<
696
- 0 , std::tuple<Iters...>>::type >::difference_type,
691
+ typename std::iterator_traits<
692
+ std:: tuple_element_t < 0 , std::tuple<Iters...>>>::difference_type,
697
693
typename ZipLongestTupleType<Iters...>::type *,
698
694
typename ZipLongestTupleType<Iters...>::type> {
699
695
public:
@@ -1501,8 +1497,8 @@ decltype(auto) apply_tuple_impl(F &&f, Tuple &&t, std::index_sequence<I...>) {
1501
1497
// / return the result.
1502
1498
template <typename F, typename Tuple>
1503
1499
decltype (auto ) apply_tuple(F &&f, Tuple &&t) {
1504
- using Indices = std::make_index_sequence<
1505
- std::tuple_size<typename std::decay <Tuple>::type >::value>;
1500
+ using Indices =
1501
+ std::make_index_sequence<std:: tuple_size<std::decay_t <Tuple>>::value>;
1506
1502
1507
1503
return detail::apply_tuple_impl (std::forward<F>(f), std::forward<Tuple>(t),
1508
1504
Indices{});
0 commit comments