|
38 | 38 | #include <utility>
|
39 | 39 | #include "llvm/ADT/iterator_range.h"
|
40 | 40 | #include "llvm/ADT/ArrayRef.h"
|
| 41 | +#include "llvm/ADT/STLExtras.h" |
41 | 42 |
|
42 | 43 | namespace swift {
|
43 | 44 | using llvm::make_range;
|
@@ -268,33 +269,6 @@ template <class T> EnumeratorRange<T> enumerate(T Begin, T End) {
|
268 | 269 | return EnumeratorRange<T>(Begin, End);
|
269 | 270 | }
|
270 | 271 |
|
271 |
| -/// An adaptor of std::none_of for ranges. |
272 |
| -template <class Range, class Predicate> |
273 |
| -inline bool none_of(const Range &R, Predicate &&P) { |
274 |
| - return std::none_of(R.begin(), R.end(), std::forward<Predicate>(P)); |
275 |
| -} |
276 |
| - |
277 |
| -/// An adaptor of std::count for ranges. |
278 |
| -/// |
279 |
| -/// We use std::result_of on Range::begin since llvm::iterator_range does not |
280 |
| -/// have a public typedef set to what is the underlying iterator. |
281 |
| -//typename std::iterator_traits<decltype(&Range::begin())>::difference_type |
282 |
| -template <class Range, class Value> |
283 |
| -inline auto count(const Range &R, Value V) |
284 |
| - -> typename std::iterator_traits<decltype(R.begin())>::difference_type { |
285 |
| - return std::count(R.begin(), R.end(), V); |
286 |
| -} |
287 |
| - |
288 |
| -/// An adaptor of std::count_if for ranges. |
289 |
| -/// |
290 |
| -/// We use std::result_of on Range::begin since llvm::iterator_range does not |
291 |
| -/// have a public typedef set to what is the underlying iterator. |
292 |
| -template <class Range, class Predicate> |
293 |
| -inline auto count_if(const Range &R, Predicate &&P) |
294 |
| - -> typename std::iterator_traits<decltype(R.begin())>::difference_type { |
295 |
| - return std::count_if(R.begin(), R.end(), std::forward<Predicate>(P)); |
296 |
| -} |
297 |
| - |
298 | 272 | } // end namespace swift
|
299 | 273 |
|
300 | 274 | #endif // SWIFT_BASIC_RANGE_H
|
0 commit comments