17 #ifndef LLVM_ADT_STLEXTRAS_H 18 #define LLVM_ADT_STLEXTRAS_H 31 #include <initializer_list> 36 #include <type_traits> 39 #ifdef EXPENSIVE_CHECKS 51 template <
typename RangeT>
54 template <
typename RangeT>
55 using ValueOfRange =
typename std::remove_reference<decltype(
65 struct negation : std::integral_constant<bool, !bool(T::value)> {};
67 template <
typename...>
struct conjunction : std::true_type {};
69 template <
typename B1,
typename... Bn>
71 : std::conditional<bool(B1::value), conjunction<Bn...>, B1>
::type {};
90 return *left < *right;
96 return *right < *left;
108 template<
typename Ret,
typename ...Params>
110 Ret (*callback)(
intptr_t callable, Params ...params) =
nullptr;
113 template<
typename Callable>
114 static Ret callback_fn(
intptr_t callable, Params ...params) {
115 return (*reinterpret_cast<Callable*>(callable))(
116 std::forward<Params>(params)...);
123 template <
typename Callable>
125 typename std::enable_if<
126 !std::is_same<
typename std::remove_reference<Callable>::type,
128 : callback(callback_fn<typename
std::remove_reference<Callable>::
type>),
129 callable(reinterpret_cast<
intptr_t>(&callable)) {}
132 return callback(callable, std::forward<Params>(params)...);
135 operator bool()
const {
return callback; }
151 namespace adl_detail {
155 template <
typename ContainerTy>
157 -> decltype(
begin(std::forward<ContainerTy>(container))) {
158 return begin(std::forward<ContainerTy>(container));
163 template <
typename ContainerTy>
165 -> decltype(
end(std::forward<ContainerTy>(container))) {
166 return end(std::forward<ContainerTy>(container));
171 template <
typename T>
173 std::declval<T>()))) {
174 swap(std::forward<T>(lhs), std::forward<T>(rhs));
179 template <
typename ContainerTy>
185 template <
typename ContainerTy>
191 template <
typename T>
200 template <
typename ItTy,
typename FuncTy,
201 typename FuncReturnTy =
202 decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
205 mapped_iterator<ItTy, FuncTy>, ItTy,
206 typename std::iterator_traits<ItTy>::iterator_category,
207 typename std::remove_reference<FuncReturnTy>::type> {
222 template <
class ItTy,
class FuncTy>
232 template <
typename Inner>
233 static yes& test(Inner *
I, decltype(I->rbegin()) * =
nullptr);
236 static no& test(...);
239 static const bool value =
sizeof(test<Ty>(
nullptr)) ==
sizeof(yes);
243 template <
typename Ty>
249 template <
typename ContainerTy>
252 nullptr) -> decltype(
make_range(
C.rbegin(),
C.rend())) {
257 template <
typename IteratorTy>
259 return std::reverse_iterator<IteratorTy>(It);
265 template <
typename ContainerTy>
291 template <
typename WrappedIteratorT,
typename PredicateT,
typename IterTag>
294 filter_iterator_base<WrappedIteratorT, PredicateT, IterTag>,
296 typename std::common_type<
297 IterTag, typename std::iterator_traits<
298 WrappedIteratorT>::iterator_category>::type> {
302 typename std::common_type<
303 IterTag,
typename std::iterator_traits<
304 WrappedIteratorT>::iterator_category>
::type>;
311 while (this->
I != End && !Pred(*this->
I))
320 : BaseT(Begin), End(End), Pred(Pred) {
325 using BaseT::operator++;
335 template <
typename WrappedIteratorT,
typename PredicateT,
336 typename IterTag = std::forward_iterator_tag>
344 :
BaseT(Begin, End, Pred) {}
348 template <
typename WrappedIteratorT,
typename PredicateT>
350 std::bidirectional_iterator_tag>
352 std::bidirectional_iterator_tag> {
354 std::bidirectional_iterator_tag>;
355 void findPrevValid() {
356 while (!this->Pred(*this->
I))
361 using BaseT::operator--;
365 : BaseT(Begin, End, Pred) {}
377 using type = std::forward_iterator_tag;
381 using type = std::bidirectional_iterator_tag;
389 std::bidirectional_iterator_tag,
390 typename std::iterator_traits<IterT>::iterator_category>::value>
::type;
397 template <
typename WrappedIteratorT,
typename PredicateT>
399 WrappedIteratorT, PredicateT,
409 template <
typename RangeT,
typename PredicateT>
412 using FilterIteratorT =
415 FilterIteratorT(
std::begin(std::forward<RangeT>(Range)),
416 std::end(std::forward<RangeT>(Range)), Pred),
417 FilterIteratorT(
std::end(std::forward<RangeT>(Range)),
418 std::end(std::forward<RangeT>(Range)), Pred));
422 template <
typename R,
typename UnaryPredicate>
423 bool all_of(R &&range, UnaryPredicate
P);
436 using type = std::tuple<decltype(*declval<Iters>())...>;
439 template <
typename ZipType,
typename... Iters>
441 ZipType,
typename std::common_type<std::bidirectional_iterator_tag,
442 typename std::iterator_traits<
443 Iters>::iterator_category...>
::type,
446 typename std::iterator_traits<
typename std::tuple_element<
447 0, std::tuple<Iters...>>
::type>::difference_type,
455 template <
typename ZipType,
typename... Iters>
457 using Base = zip_traits<ZipType, Iters...>;
464 return value_type(*std::get<Ns>(iterators)...);
467 template <
size_t... Ns>
469 return std::tuple<Iters...>(std::next(std::get<Ns>(iterators))...);
472 template <
size_t... Ns>
474 return std::tuple<Iters...>(std::prev(std::get<Ns>(iterators))...);
488 return *
reinterpret_cast<ZipType *
>(
this);
492 static_assert(Base::IsBidirectional,
493 "All inner iterators must be at least bidirectional.");
495 return *
reinterpret_cast<ZipType *
>(
this);
499 template <
typename... Iters>
504 return std::get<0>(this->iterators) == std::get<0>(other.
iterators);
510 template <
typename... Iters>
512 template <
size_t... Ns>
514 return all_of(std::initializer_list<bool>{std::get<Ns>(this->iterators) !=
529 template <
template <
typename...>
class ItType,
typename...
Args>
class zippy {
531 using iterator = ItType<decltype(std::begin(std::declval<Args>()))...>;
539 std::tuple<
Args...> ts;
558 template <
typename T,
typename U,
typename...
Args>
562 std::forward<T>(t), std::forward<U>(u), std::forward<Args>(args)...);
567 template <
typename T,
typename U,
typename...
Args>
571 std::forward<T>(t), std::forward<U>(u), std::forward<Args>(args)...);
584 template <
typename ValueT,
typename... IterTs>
587 std::forward_iterator_tag, ValueT> {
588 using BaseT =
typename concat_iterator::iterator_facade_base;
596 std::tuple<std::pair<IterTs, IterTs>...> IterPairs;
602 template <
size_t Index>
bool incrementHelper() {
603 auto &IterPair = std::get<Index>(IterPairs);
604 if (IterPair.first == IterPair.second)
617 &concat_iterator::incrementHelper<Ns>...};
620 for (
auto &IncrementHelperFn : IncrementHelperFns)
621 if ((this->*IncrementHelperFn)())
630 template <
size_t Index>
ValueT *getHelper()
const {
631 auto &IterPair = std::get<Index>(IterPairs);
632 if (IterPair.first == IterPair.second)
635 return &*IterPair.first;
645 &concat_iterator::getHelper<Ns>...};
648 for (
auto &GetHelperFn : GetHelperFns)
649 if (
ValueT *
P = (this->*GetHelperFn)())
652 llvm_unreachable(
"Attempted to get a pointer from an end concat iterator!");
660 template <
typename... RangeTs>
664 using BaseT::operator++;
674 return IterPairs == RHS.IterPairs;
692 std::tuple<RangeTs...> Ranges;
695 return iterator(std::get<Ns>(Ranges)...);
699 std::end(std::get<Ns>(Ranges)))...);
704 : Ranges(
std::forward<RangeTs>(Ranges)...) {}
715 template <
typename ValueT,
typename... RangeTs>
717 static_assert(
sizeof...(RangeTs) > 1,
718 "Need more than one range to concatenate!");
720 std::forward<RangeTs>(Ranges)...);
730 template <
typename T>
bool operator()(
const T &lhs,
const T &rhs)
const {
731 return lhs.first < rhs.first;
738 template <
typename T>
bool operator()(
const T &lhs,
const T &rhs)
const {
739 return lhs.second < rhs.second;
749 static constexpr
size_t size() {
return sizeof...(I); }
753 template <
size_t...
I>
756 template <std::size_t
N, std::size_t...
I>
758 template <std::size_t...
I>
762 template <
class... Ts>
773 static const bool value =
false;
776 template <
typename T,
typename U,
typename... Ts>
778 static const bool value =
779 std::is_same<T, U>::value ||
is_one_of<
T, Ts...>::value;
785 static const bool value =
true;
788 template <
typename T,
typename U,
typename... Ts>
790 static const bool value =
791 std::is_base_of<T, U>::value &&
are_base_of<
T, Ts...>::value;
799 template <
class T, std::
size_t N>
807 if (std::less<T>()(*reinterpret_cast<const T*>(P1),
808 *reinterpret_cast<const T*>(P2)))
810 if (std::less<T>()(*reinterpret_cast<const T*>(P2),
811 *reinterpret_cast<const T*>(P1)))
820 (
const void*,
const void*) {
821 return array_pod_sort_comparator<T>;
838 template<
class IteratorTy>
842 auto NElts = End - Start;
843 if (NElts <= 1)
return;
844 #ifdef EXPENSIVE_CHECKS 845 std::mt19937 Generator(std::random_device{}());
846 std::shuffle(Start, End, Generator);
851 template <
class IteratorTy>
853 IteratorTy Start, IteratorTy End,
855 const typename std::iterator_traits<IteratorTy>::value_type *,
856 const typename std::iterator_traits<IteratorTy>::value_type *)) {
859 auto NElts = End - Start;
860 if (NElts <= 1)
return;
861 #ifdef EXPENSIVE_CHECKS 862 std::mt19937 Generator(std::random_device{}());
863 std::shuffle(Start, End, Generator);
865 qsort(&*Start, NElts,
sizeof(*Start),
866 reinterpret_cast<int (*)(
const void *,
const void *)
>(
Compare));
871 template <
typename IteratorTy>
872 inline void sort(IteratorTy Start, IteratorTy End) {
873 #ifdef EXPENSIVE_CHECKS 874 std::mt19937 Generator(std::random_device{}());
875 std::shuffle(Start, End, Generator);
880 template <
typename IteratorTy,
typename Compare>
881 inline void sort(IteratorTy Start, IteratorTy End,
Compare Comp) {
882 #ifdef EXPENSIVE_CHECKS 883 std::mt19937 Generator(std::random_device{}());
884 std::shuffle(Start, End, Generator);
895 template<
typename Container>
904 template<
typename Container>
913 template <
typename R,
typename UnaryPredicate>
920 template <
typename R,
typename UnaryPredicate>
927 template <
typename R,
typename UnaryPredicate>
934 template <
typename R,
typename UnaryPredicate>
941 template <
typename R,
typename T>
948 template <
typename R,
typename UnaryPredicate>
953 template <
typename R,
typename UnaryPredicate>
960 template <
typename R,
typename UnaryPredicate>
967 template <
typename R,
typename OutputIt,
typename UnaryPredicate>
968 OutputIt
copy_if(R &&Range, OutputIt Out, UnaryPredicate
P) {
972 template <
typename R,
typename OutputIt>
973 OutputIt
copy(R &&Range, OutputIt Out) {
979 template <
typename R,
typename E>
986 template <
typename R,
typename E>
987 auto count(R &&Range,
const E &Element) ->
988 typename std::iterator_traits<decltype(adl_begin(Range))>::difference_type {
994 template <
typename R,
typename UnaryPredicate>
996 typename std::iterator_traits<decltype(adl_begin(Range))>::difference_type {
1002 template <
typename R,
typename OutputIt,
typename UnaryPredicate>
1003 OutputIt
transform(R &&Range, OutputIt d_first, UnaryPredicate
P) {
1009 template <
typename R,
typename UnaryPredicate>
1016 template <
typename R,
typename ForwardIt>
1024 template <
unsigned Size,
typename R>
1037 template <
typename Container,
typename UnaryPredicate>
1044 template <
typename R>
1045 auto size(R &&Range,
typename std::enable_if<
1046 std::is_same<
typename std::iterator_traits<decltype(
1047 Range.begin())>::iterator_category,
1048 std::random_access_iterator_tag>::value,
1049 void>::
type * =
nullptr)
1050 -> decltype(std::distance(Range.begin(), Range.end())) {
1051 return std::distance(Range.begin(), Range.end());
1067 template <
class T,
class...
Args>
1068 typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
1070 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
1082 typename std::enable_if<std::is_array<T>::value && std::extent<T>::value == 0,
1083 std::unique_ptr<T>>::type
1085 return std::unique_ptr<T>(
new typename std::remove_extent<T>::type[n]());
1089 template <
class T,
class...
Args>
1090 typename std::enable_if<std::extent<T>::value != 0>::type
1099 template<
typename First,
typename Second>
1102 return std::hash<First>()(P.first) * 31 + std::hash<Second>()(P.second);
1108 template <
typename A,
typename B>
bool operator()(A &&a,
B &&b)
const {
1109 return std::forward<A>(a) < std::forward<B>(b);
1115 template <
typename A,
typename B>
bool operator()(A &&a,
B &&b)
const {
1116 return std::forward<A>(a) == std::forward<B>(b);
1128 template <
typename A,
typename B>
1132 return func(*lhs, *rhs);
1145 : Index(Index), Iter(Iter) {}
1148 Index = Other.Index;
1162 template <
typename R>
1165 enumerator_iter<R>, std::forward_iterator_tag, result_pair<R>,
1166 typename std::iterator_traits<IterOfRange<R>>::difference_type,
1167 typename std::iterator_traits<IterOfRange<R>>::pointer,
1168 typename std::iterator_traits<IterOfRange<R>>::reference> {
1192 return Result.Iter == RHS.Result.Iter;
1243 template <
typename F,
typename Tuple, std::size_t... I>
1245 -> decltype(std::forward<F>(f)(std::get<I>(std::forward<Tuple>(t))...)) {
1246 return std::forward<F>(f)(std::get<I>(std::forward<Tuple>(t))...);
1254 template <
typename F,
typename Tuple>
1256 std::forward<F>(f), std::forward<Tuple>(t),
1258 std::tuple_size<
typename std::decay<Tuple>::type>::value>{})) {
1260 std::tuple_size<typename std::decay<Tuple>::type>::value>;
1268 #endif // LLVM_ADT_STLEXTRAS_H detail::concat_range< ValueT, RangeTs... > concat(RangeTs &&... Ranges)
Concatenated range across two or more ranges.
result_pair(std::size_t Index, IterOfRange< R > Iter)
void DeleteContainerSeconds(Container &C)
In a container of pairs (usually a map) whose second element is a pointer, deletes the second element...
void DeleteContainerPointers(Container &C)
For a container of pointers, deletes the pointers and then clears the container.
bool operator()(const Ty *left, const Ty *right) const
bool operator==(const enumerator_iter< R > &RHS) const
const_iterator end(StringRef path)
Get end iterator over path.
filter_iterator_impl(WrappedIteratorT Begin, WrappedIteratorT End, PredicateT Pred)
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
Ret operator()(Params ...params) const
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
bool operator()(const T &lhs, const T &rhs) const
typename fwd_or_bidi_tag_impl< std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< IterT >::iterator_category >::value >::type type
Compute iterated dominance frontiers using a linear time algorithm.
typename Base::value_type value_type
typename std::remove_reference< decltype(*std::begin(std::declval< RangeT & >()))>::type ValueOfRange
decltype(iterators) tup_inc(index_sequence< Ns... >) const
Function object to check whether the second component of a std::pair compares less than the second co...
OutputIt copy_if(R &&Range, OutputIt Out, UnaryPredicate P)
Provide wrappers to std::copy_if which take ranges instead of having to pass begin/end explicitly...
typename iterator::value_type value_type
const Ty & operator()(const Ty &self) const
result_type & operator*()
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
filter_iterator_base(WrappedIteratorT Begin, WrappedIteratorT End, PredicateT Pred)
int(*)(const void *, const void *) get_array_pod_sort_comparator(const T &)
get_array_pod_sort_comparator - This is an internal helper function used to get type deduction of T r...
bool operator()(const T &lhs, const T &rhs) const
An efficient, type-erasing, non-owning reference to a callable.
A functor like C++14's std::less<void> in its absence.
zip_common(Iters &&... ts)
void adl_swap(T &&lhs, T &&rhs) noexcept(noexcept(adl_detail::adl_swap(std::declval< T >(), std::declval< T >())))
enumerator_iter(IterOfRange< R > EndIter)
auto count_if(R &&Range, UnaryPredicate P) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count_if to count the number of times an element satisfying a given pred...
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
block Block Frequency true
std::tuple< decltype(*declval< Iters >())... > type
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&... args)
Constructs a new T() with the given args and returns a unique_ptr<T> which owns the object...
typename iterator::pointer pointer
int array_pod_sort_comparator(const void *P1, const void *P2)
Adapt std::less<T> for array_pod_sort.
void adl_swap(T &&lhs, T &&rhs) noexcept(noexcept(swap(std::declval< T >(), std::declval< T >())))
Metafunction to determine if T& or T has a member called rbegin().
function_ref(Callable &&callable, typename std::enable_if< !std::is_same< typename std::remove_reference< Callable >::type, function_ref >::value >::type *=nullptr)
Ty & operator()(Ty &self) const
concat_range(RangeTs &&... Ranges)
std::bidirectional_iterator_tag type
bool none_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly...
decltype(iterators) tup_dec(index_sequence< Ns... >) const
SmallVector< typename std::remove_const< detail::ValueOfRange< R > >::type, Size > to_vector(R &&Range)
Given a range of type R, iterate the entire range and return a SmallVector with elements of the vecto...
Alias for the common case of a sequence of size_ts.
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
bool operator()(const Ty *left, const Ty *right) const
filter_iterator_impl & operator--()
enumerator_iter< R > & operator++()
auto apply_tuple(F &&f, Tuple &&t) -> decltype(detail::apply_tuple_impl(std::forward< F >(f), std::forward< Tuple >(t), build_index_impl< std::tuple_size< typename std::decay< Tuple >::type >::value >
Given an input tuple (a1, a2, ..., an), pass the arguments of the tuple variadically to f as if by ca...
auto partition(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::partition which take ranges instead of having to pass begin/end explicitly...
auto lower_bound(R &&Range, ForwardIt I) -> decltype(adl_begin(Range))
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
enumerator_iter(std::size_t Index, IterOfRange< R > Iter)
Helper to store a sequence of ranges being concatenated and access them.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
traits class for checking whether type T is one of any of the given types in the variadic list...
ValueOfRange< R > & value()
typename iterator::reference reference
ItType< decltype(std::begin(std::declval< Args >()))... > iterator
void array_pod_sort(IteratorTy Start, IteratorTy End)
array_pod_sort - This sorts an array with the specified start and end extent.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
auto operator()(A &lhs, B &rhs) const -> decltype(func(*lhs, *rhs))
auto adl_end(ContainerTy &&container) -> decltype(end(std::forward< ContainerTy >(container)))
CRTP base class for adapting an iterator to a different type.
mapped_iterator(ItTy U, FuncTy F)
detail::zippy< detail::zip_shortest, T, U, Args... > zip(T &&t, U &&u, Args &&... args)
zip iterator for two or more iteratable types.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const result_type & operator*() const
mapped_iterator< ItTy, FuncTy > map_iterator(ItTy I, FuncTy F)
auto adl_begin(ContainerTy &&container) -> decltype(adl_detail::adl_begin(std::forward< ContainerTy >(container)))
void sort(IteratorTy Start, IteratorTy End, Compare Comp)
filter_iterator_impl(WrappedIteratorT Begin, WrappedIteratorT End, PredicateT Pred)
Helper to determine if type T has a member called rbegin().
bool any_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
auto remove_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly...
auto find_if_not(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
detail::zippy< detail::zip_first, T, U, Args... > zip_first(T &&t, U &&u, Args &&... args)
zip iterator that, for the sake of efficiency, assumes the first iteratee to be the shortest...
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static constexpr size_t size()
void sort(IteratorTy Start, IteratorTy End)
bool operator()(A &&a, B &&b) const
auto apply_tuple_impl(F &&f, Tuple &&t, index_sequence< I... >) -> decltype(std::forward< F >(f)(std::get< I >(std::forward< Tuple >(t))...))
A functor like C++14's std::equal<void> in its absence.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
value_type deref(index_sequence< Ns... >) const
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
An iterator adaptor that filters the elements of given inner iterators.
Creates a compile-time integer sequence for a parameter pack.
auto adl_begin(ContainerTy &&container) -> decltype(begin(std::forward< ContainerTy >(container)))
typename iterator::difference_type difference_type
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
A range adaptor for a pair of iterators.
bool operator()(A &&a, B &&b) const
std::forward_iterator_tag type
Represents a compile-time sequence of integers.
filter_iterator_base & operator++()
Helper which sets its type member to forward_iterator_tag if the category of IterT does not derive fr...
enumerator_iter< R > & operator=(const enumerator_iter< R > &Other)
concat_iterator & operator++()
result_pair< R > & operator=(const result_pair< R > &Other)
ValueT & operator*() const
bool operator==(const zip_first< Iters... > &other) const
bool operator==(const concat_iterator &RHS) const
typename iterator::iterator_category iterator_category
function_ref(std::nullptr_t)
decltype(std::begin(std::declval< RangeT & >())) IterOfRange
const ValueOfRange< R > & value() const
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
std::tuple< Iters... > iterators
OutputIt transform(R &&Range, OutputIt d_first, UnaryPredicate P)
Wrapper function around std::transform to apply a function to a range and store the result elsewhere...
const value_type operator*() const
auto adl_end(ContainerTy &&container) -> decltype(adl_detail::adl_end(std::forward< ContainerTy >(container)))
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::reverse_iterator< IteratorTy > make_reverse_iterator(IteratorTy It)
traits class for checking whether type T is a base class for all the given types in the variadic list...
enumerator_iter< R > begin()
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
enumerator_iter< R > end()
Specialization of filter_iterator_base for forward iteration only.
Binary functor that adapts to any other binary functor after dereferencing operands.
Iterator wrapper that concatenates sequences together.
Utility type to build an inheritance chain that makes it easy to rank overload candidates.
zip_shortest(Iters &&... ts)
UnaryPredicate for_each(R &&Range, UnaryPredicate P)
Provide wrappers to std::for_each which take ranges instead of having to pass begin/end explicitly...
OutputIt copy(R &&Range, OutputIt Out)
zip_first(Iters &&... ts)
std::size_t index() const
Function object to check whether the first component of a std::pair compares less than the first comp...
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
concat_iterator(RangeTs &&... Ranges)
Constructs an iterator from a squence of ranges.
bool operator==(const zip_shortest< Iters... > &other) const
detail::enumerator< R > enumerate(R &&TheRange)
Given an input range, returns a new range whose values are are pair (A,B) such that A is the 0-based ...
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
size_t operator()(const std::pair< First, Second > &P) const