LLVM  16.0.0git
Classes | Namespaces | Typedefs | Functions | Variables
STLExtras.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/ADT/identity.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Config/abi-breaking.h"
#include "llvm/Support/ErrorHandling.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <limits>
#include <memory>
#include <tuple>
#include <type_traits>
#include <utility>
Include dependency graph for STLExtras.h:

Go to the source code of this file.

Classes

struct  llvm::SameType< T, T >
 
struct  llvm::make_const_ptr< T >
 
struct  llvm::make_const_ref< T >
 
struct  llvm::detail::detector< class, Op, Args >
 
struct  llvm::detail::detector< std::void_t< Op< Args... > >, Op, Args... >
 
struct  llvm::function_traits< T, isClass >
 This class provides various trait information about a callable object. More...
 
struct  llvm::function_traits< ReturnType(ClassType::*)(Args...) const, false >
 Overload for class function types. More...
 
struct  llvm::function_traits< ReturnType(ClassType::*)(Args...), false >
 Overload for class function types. More...
 
struct  llvm::function_traits< ReturnType(*)(Args...), false >
 Overload for non-class function types. More...
 
struct  llvm::function_traits< ReturnType(*const)(Args...), false >
 
struct  llvm::function_traits< ReturnType(&)(Args...), false >
 Overload for non-class function type references. More...
 
struct  llvm::detail::TypesAreDistinct< T, Us >
 
struct  llvm::detail::TypesAreDistinct< T, Us >
 
struct  llvm::detail::TypesAreDistinct< T >
 
struct  llvm::TypesAreDistinct< Ts >
 Determine if all types in Ts are distinct. More...
 
struct  llvm::TypesAreDistinct<>
 
struct  llvm::TypesAreDistinct< Ts >
 Determine if all types in Ts are distinct. More...
 
struct  llvm::FirstIndexOfType< T, Us >
 Find the first index where a type appears in a list of types. More...
 
struct  llvm::FirstIndexOfType< T, U, Us... >
 
struct  llvm::FirstIndexOfType< T, T, Us... >
 
class  llvm::mapped_iterator< ItTy, FuncTy, ReferenceTy >
 
class  llvm::mapped_iterator_base< DerivedT, ItTy, ReferenceTy >
 A base type of mapped iterator, that is useful for building derived iterators that do not need/want to store the map function (as in mapped_iterator). More...
 
class  llvm::has_rbegin_impl< Ty >
 Helper to determine if type T has a member called rbegin(). More...
 
struct  llvm::has_rbegin< Ty >
 Metafunction to determine if T& or T has a member called rbegin(). More...
 
class  llvm::filter_iterator_base< WrappedIteratorT, PredicateT, IterTag >
 An iterator adaptor that filters the elements of given inner iterators. More...
 
class  llvm::filter_iterator_impl< WrappedIteratorT, PredicateT, IterTag >
 Specialization of filter_iterator_base for forward iteration only. More...
 
class  llvm::filter_iterator_impl< WrappedIteratorT, PredicateT, std::bidirectional_iterator_tag >
 Specialization of filter_iterator_base for bidirectional iteration. More...
 
struct  llvm::detail::fwd_or_bidi_tag_impl< is_bidirectional >
 
struct  llvm::detail::fwd_or_bidi_tag_impl< true >
 
struct  llvm::detail::fwd_or_bidi_tag< IterT >
 Helper which sets its type member to forward_iterator_tag if the category of IterT does not derive from bidirectional_iterator_tag, and to bidirectional_iterator_tag otherwise. More...
 
class  llvm::early_inc_iterator_impl< WrappedIteratorT >
 A pseudo-iterator adaptor that is designed to implement "early increment" style loops. More...
 
struct  llvm::detail::ZipTupleType< Iters >
 
struct  llvm::detail::zip_common< ZipType, Iters >
 
struct  llvm::detail::zip_first< Iters >
 
class  llvm::detail::zip_shortest< Iters >
 
class  llvm::detail::zippy< ItType, Args >
 
struct  llvm::detail::ZipLongestItemType< Iter >
 
struct  llvm::detail::ZipLongestTupleType< Iters >
 
class  llvm::detail::zip_longest_iterator< Iters >
 
class  llvm::detail::zip_longest_range< Args >
 
class  llvm::concat_iterator< ValueT, IterTs >
 Iterator wrapper that concatenates sequences together. More...
 
class  llvm::detail::concat_range< ValueT, RangeTs >
 Helper to store a sequence of ranges being concatenated and access them. More...
 
class  llvm::indexed_accessor_iterator< DerivedT, BaseT, T, PointerT, ReferenceT >
 A utility class used to implement an iterator that contains some base object and an index. More...
 
class  llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >
 The class represents the base of a range of indexed_accessor_iterators. More...
 
class  llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::iterator
 An iterator element of this range. More...
 
class  llvm::indexed_accessor_range< DerivedT, BaseT, T, PointerT, ReferenceT >
 This class provides an implementation of a range of indexed_accessor_iterators where the base is not indexable. More...
 
class  llvm::detail::first_or_second_type< EltTy, FirstTy >
 Return a reference to the first or second member of a reference. More...
 
struct  llvm::less_first
 Function object to check whether the first component of a std::pair compares less than the first component of another std::pair. More...
 
struct  llvm::less_second
 Function object to check whether the second component of a std::pair compares less than the second component of another std::pair. More...
 
struct  llvm::on_first< FuncTy >
 Function object to apply a binary function to the first component of a std::pair. More...
 
struct  llvm::rank< N >
 Utility type to build an inheritance chain that makes it easy to rank overload candidates. More...
 
struct  llvm::rank< 0 >
 
struct  llvm::detail::Visitor< Ts >
 
struct  llvm::detail::Visitor< HeadT, TailTs... >
 
struct  llvm::detail::Visitor< HeadT >
 
struct  llvm::FreeDeleter
 
struct  llvm::pair_hash< First, Second >
 
struct  llvm::deref< T >
 Binary functor that adapts to any other binary functor after dereferencing operands. More...
 
class  llvm::detail::enumerator_iter< R >
 
struct  llvm::detail::result_pair< R >
 
class  llvm::detail::enumerator_iter< R >
 
class  llvm::detail::enumerator< R >
 
struct  std::tuple_size< llvm::detail::result_pair< R > >
 
struct  std::tuple_element< i, llvm::detail::result_pair< R > >
 

Namespaces

 llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
 llvm::detail
 
 llvm::adl_detail
 
 std
 

Typedefs

template<typename RangeT >
using llvm::detail::IterOfRange = decltype(std::begin(std::declval< RangeT & >()))
 
template<typename RangeT >
using llvm::detail::ValueOfRange = std::remove_reference_t< decltype(*std::begin(std::declval< RangeT & >()))>
 
template<template< class... > class Op, class... Args>
using llvm::is_detected = typename detail::detector< void, Op, Args... >::value_t
 Detects if a given trait holds for some set of arguments 'Args'. More...
 
template<typename T , typename... Ts>
using llvm::is_one_of = std::disjunction< std::is_same< T, Ts >... >
 traits class for checking whether type T is one of any of the given types in the variadic list. More...
 
template<typename T , typename... Ts>
using llvm::are_base_of = std::conjunction< std::is_base_of< T, Ts >... >
 traits class for checking whether type T is a base class for all the given types in the variadic list. More...
 
template<size_t I, typename... Ts>
using llvm::TypeAtIndex = std::tuple_element_t< I, std::tuple< Ts... > >
 Find the type at a given index in a list of types. More...
 
template<typename WrappedIteratorT , typename PredicateT >
using llvm::filter_iterator = filter_iterator_impl< WrappedIteratorT, PredicateT, typename detail::fwd_or_bidi_tag< WrappedIteratorT >::type >
 Defines filter_iterator to a suitable specialization of filter_iterator_impl, based on the underlying iterator's category. More...
 
template<typename ZipType , typename... Iters>
using llvm::detail::zip_traits = iterator_facade_base< ZipType, std::common_type_t< std::bidirectional_iterator_tag, typename std::iterator_traits< Iters >::iterator_category... >, typename ZipTupleType< Iters... >::type, typename std::iterator_traits< std::tuple_element_t< 0, std::tuple< Iters... > >>::difference_type, typename ZipTupleType< Iters... >::type *, typename ZipTupleType< Iters... >::type >
 
template<typename T >
using llvm::detail::sort_trivially_copyable = std::conjunction< std::is_pointer< T >, std::is_trivially_copyable< typename std::iterator_traits< T >::value_type > >
 

Functions

template<typename EnumTy1 , typename EnumTy2 , typename UT1 = std::enable_if_t<std::is_enum<EnumTy1>::value, std::underlying_type_t<EnumTy1>>, typename UT2 = std::enable_if_t<std::is_enum<EnumTy2>::value, std::underlying_type_t<EnumTy2>>>
constexpr auto llvm::addEnumValues (EnumTy1 LHS, EnumTy2 RHS)
 Helper which adds two underlying types of enumeration type. More...
 
template<typename ContainerTy >
decltype(auto) llvm::adl_detail::adl_begin (ContainerTy &&container)
 
template<typename ContainerTy >
decltype(auto) llvm::adl_detail::adl_end (ContainerTy &&container)
 
template<typename T >
void llvm::adl_detail::adl_swap (T &&lhs, T &&rhs) noexcept(noexcept(swap(std::declval< T >(), std::declval< T >())))
 
template<typename ContainerTy >
decltype(auto) llvm::adl_begin (ContainerTy &&container)
 
template<typename ContainerTy >
decltype(auto) llvm::adl_end (ContainerTy &&container)
 
template<typename T >
void llvm::adl_swap (T &&lhs, T &&rhs) noexcept(noexcept(adl_detail::adl_swap(std::declval< T >(), std::declval< T >())))
 
template<typename T >
constexpr bool llvm::empty (const T &RangeOrContainer)
 Test whether RangeOrContainer is empty. Similar to C++17 std::empty. More...
 
template<typename ContainerTy >
bool llvm::hasSingleElement (ContainerTy &&C)
 Returns true if the given container only contains a single element. More...
 
template<typename T >
auto llvm::drop_begin (T &&RangeOrContainer, size_t N=1)
 Return a range covering RangeOrContainer with the first N elements excluded. More...
 
template<typename T >
auto llvm::drop_end (T &&RangeOrContainer, size_t N=1)
 Return a range covering RangeOrContainer with the last N elements excluded. More...
 
template<class ItTy , class FuncTy >
mapped_iterator< ItTy, FuncTy > llvm::map_iterator (ItTy I, FuncTy F)
 
template<class ContainerTy , class FuncTy >
auto llvm::map_range (ContainerTy &&C, FuncTy F)
 
template<typename ContainerTy >
auto llvm::reverse (ContainerTy &&C)
 
template<typename RangeT , typename PredicateT >
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > llvm::make_filter_range (RangeT &&Range, PredicateT Pred)
 Convenience function that takes a range of elements and a predicate, and return a new filter_iterator range. More...
 
template<typename RangeT >
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > llvm::make_early_inc_range (RangeT &&Range)
 Make a range that does early increment to allow mutation of the underlying range without disrupting iteration. More...
 
template<typename R , typename UnaryPredicate >
bool llvm::all_of (R &&Range, UnaryPredicate P)
 Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename UnaryPredicate >
bool llvm::any_of (R &&Range, UnaryPredicate P)
 Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename T , typename U , typename... Args>
detail::zippy< detail::zip_shortest, T, U, Args... > llvm::zip (T &&t, U &&u, Args &&... args)
 zip iterator for two or more iteratable types. More...
 
template<typename T , typename U , typename... Args>
detail::zippy< detail::zip_first, T, U, Args... > llvm::zip_first (T &&t, U &&u, Args &&... args)
 zip iterator that, for the sake of efficiency, assumes the first iteratee to be the shortest. More...
 
template<typename Iter >
Iter llvm::detail::next_or_end (const Iter &I, const Iter &End)
 
template<typename Iter >
auto llvm::detail::deref_or_none (const Iter &I, const Iter &End) -> llvm::Optional< std::remove_const_t< std::remove_reference_t< decltype(*I)>>>
 
template<typename T , typename U , typename... Args>
detail::zip_longest_range< T, U, Args... > llvm::zip_longest (T &&t, U &&u, Args &&... args)
 Iterate over two or more iterators at the same time. More...
 
template<typename ValueT , typename... RangeTs>
detail::concat_range< ValueT, RangeTs... > llvm::concat (RangeTs &&... Ranges)
 Concatenated range across two or more ranges. More...
 
template<typename ContainerTy >
auto llvm::make_first_range (ContainerTy &&c)
 Given a container of pairs, return a range over the first elements. More...
 
template<typename ContainerTy >
auto llvm::make_second_range (ContainerTy &&c)
 Given a container of pairs, return a range over the second elements. More...
 
template<typename... CallableTs>
constexpr decltype(auto) llvm::makeVisitor (CallableTs &&...Callables)
 Returns an opaquely-typed Callable object whose operator() overload set is the sum of the operator() overload sets of each CallableT in CallableTs. More...
 
template<class Iterator , class RNG >
void llvm::shuffle (Iterator first, Iterator last, RNG &&g)
 
template<typename T >
int llvm::array_pod_sort_comparator (const void *P1, const void *P2)
 Adapt std::less<T> for array_pod_sort. More...
 
template<class IteratorTy >
void llvm::array_pod_sort (IteratorTy Start, IteratorTy End)
 array_pod_sort - This sorts an array with the specified start and end extent. More...
 
template<class IteratorTy >
void llvm::array_pod_sort (IteratorTy Start, IteratorTy End, int(*Compare)(const typename std::iterator_traits< IteratorTy >::value_type *, const typename std::iterator_traits< IteratorTy >::value_type *))
 
template<typename IteratorTy >
void llvm::sort (IteratorTy Start, IteratorTy End)
 
template<typename Container >
void llvm::sort (Container &&C)
 
template<typename IteratorTy , typename Compare >
void llvm::sort (IteratorTy Start, IteratorTy End, Compare Comp)
 
template<typename Container , typename Compare >
void llvm::sort (Container &&C, Compare Comp)
 
template<typename R >
auto llvm::size (R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
 Get the size of a range. More...
 
template<typename R , typename UnaryFunction >
UnaryFunction llvm::for_each (R &&Range, UnaryFunction F)
 Provide wrappers to std::for_each which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename UnaryPredicate >
bool llvm::none_of (R &&Range, UnaryPredicate P)
 Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename T >
auto llvm::find (R &&Range, const T &Val)
 Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::find_if (R &&Range, UnaryPredicate P)
 Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::find_if_not (R &&Range, UnaryPredicate P)
 
template<typename R , typename UnaryPredicate >
auto llvm::remove_if (R &&Range, UnaryPredicate P)
 Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename OutputIt , typename UnaryPredicate >
OutputIt llvm::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. More...
 
template<typename R , typename OutputIt >
OutputIt llvm::copy (R &&Range, OutputIt Out)
 
template<typename R , typename OutputIt , typename UnaryPredicate , typename T >
OutputIt llvm::replace_copy_if (R &&Range, OutputIt Out, UnaryPredicate P, const T &NewValue)
 Provide wrappers to std::replace_copy_if which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename OutputIt , typename T >
OutputIt llvm::replace_copy (R &&Range, OutputIt Out, const T &OldValue, const T &NewValue)
 Provide wrappers to std::replace_copy which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename OutputIt >
OutputIt llvm::move (R &&Range, OutputIt Out)
 Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename E >
bool llvm::is_contained (R &&Range, const E &Element)
 Wrapper function around std::find to detect if an element exists in a container. More...
 
template<typename T >
constexpr bool llvm::is_contained (std::initializer_list< T > Set, T Value)
 
template<typename R , typename Compare >
bool llvm::is_sorted (R &&Range, Compare C)
 Wrapper function around std::is_sorted to check if elements in a range R are sorted with respect to a comparator C. More...
 
template<typename R >
bool llvm::is_sorted (R &&Range)
 Wrapper function around std::is_sorted to check if elements in a range R are sorted in non-descending order. More...
 
template<typename R , typename E >
auto llvm::count (R &&Range, const E &Element)
 Wrapper function around std::count to count the number of times an element Element occurs in the given range Range. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::count_if (R &&Range, UnaryPredicate P)
 Wrapper function around std::count_if to count the number of times an element satisfying a given predicate occurs in a range. More...
 
template<typename R , typename OutputIt , typename UnaryFunction >
OutputIt llvm::transform (R &&Range, OutputIt d_first, UnaryFunction F)
 Wrapper function around std::transform to apply a function to a range and store the result elsewhere. More...
 
template<typename R , typename UnaryPredicate >
auto llvm::partition (R &&Range, UnaryPredicate P)
 Provide wrappers to std::partition which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename T >
auto llvm::lower_bound (R &&Range, T &&Value)
 Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename T , typename Compare >
auto llvm::lower_bound (R &&Range, T &&Value, Compare C)
 
template<typename R , typename T >
auto llvm::upper_bound (R &&Range, T &&Value)
 Provide wrappers to std::upper_bound which take ranges instead of having to pass begin/end explicitly. More...
 
template<typename R , typename T , typename Compare >
auto llvm::upper_bound (R &&Range, T &&Value, Compare C)
 
template<typename R >
void llvm::stable_sort (R &&Range)
 
template<typename R , typename Compare >
void llvm::stable_sort (R &&Range, Compare C)
 
template<typename R , typename Predicate , typename Val = decltype(*adl_begin(std::declval<R>()))>
auto llvm::partition_point (R &&Range, Predicate P)
 Binary search for the first iterator in a range where a predicate is false. More...
 
template<typename Range , typename Predicate >
auto llvm::unique (Range &&R, Predicate P)
 
template<typename L , typename R >
bool llvm::equal (L &&LRange, R &&RRange)
 Wrapper function around std::equal to detect if pair-wise elements between two ranges are the same. More...
 
template<typename R >
bool llvm::all_equal (R &&Range)
 Returns true if all elements in Range are equal or when the Range is empty. More...
 
template<typename T >
bool llvm::all_equal (std::initializer_list< T > Values)
 Returns true if all Values in the initializer lists are equal or the list. More...
 
template<typename Container , typename UnaryPredicate >
void llvm::erase_if (Container &C, UnaryPredicate P)
 Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent to: More...
 
template<typename Container , typename ValueType >
void llvm::erase_value (Container &C, ValueType V)
 Wrapper function to remove a value from a container: More...
 
template<typename Container , typename Range >
void llvm::append_range (Container &C, Range &&R)
 Wrapper function to append a range to a container. More...
 
template<typename Container , typename RandomAccessIterator >
void llvm::replace (Container &Cont, typename Container::iterator ContIt, typename Container::iterator ContEnd, RandomAccessIterator ValIt, RandomAccessIterator ValEnd)
 Given a sequence container Cont, replace the range [ContIt, ContEnd) with the range [ValIt, ValEnd) (which is not from the same container). More...
 
template<typename Container , typename Range = std::initializer_list< typename Container::value_type>>
void llvm::replace (Container &Cont, typename Container::iterator ContIt, typename Container::iterator ContEnd, Range R)
 Given a sequence container Cont, replace the range [ContIt, ContEnd) with the range R. More...
 
template<typename ForwardIterator , typename UnaryFunctor , typename NullaryFunctor , typename = std::enable_if_t< !std::is_constructible<StringRef, UnaryFunctor>::value && !std::is_constructible<StringRef, NullaryFunctor>::value>>
void llvm::interleave (ForwardIterator begin, ForwardIterator end, UnaryFunctor each_fn, NullaryFunctor between_fn)
 An STL-style algorithm similar to std::for_each that applies a second functor between every pair of elements. More...
 
template<typename Container , typename UnaryFunctor , typename NullaryFunctor , typename = std::enable_if_t< !std::is_constructible<StringRef, UnaryFunctor>::value && !std::is_constructible<StringRef, NullaryFunctor>::value>>
void llvm::interleave (const Container &c, UnaryFunctor each_fn, NullaryFunctor between_fn)
 
template<typename Container , typename UnaryFunctor , typename StreamT , typename T = detail::ValueOfRange<Container>>
void llvm::interleave (const Container &c, StreamT &os, UnaryFunctor each_fn, const StringRef &separator)
 Overload of interleave for the common case of string separator. More...
 
template<typename Container , typename StreamT , typename T = detail::ValueOfRange<Container>>
void llvm::interleave (const Container &c, StreamT &os, const StringRef &separator)
 
template<typename Container , typename UnaryFunctor , typename StreamT , typename T = detail::ValueOfRange<Container>>
void llvm::interleaveComma (const Container &c, StreamT &os, UnaryFunctor each_fn)
 
template<typename Container , typename StreamT , typename T = detail::ValueOfRange<Container>>
void llvm::interleaveComma (const Container &c, StreamT &os)
 
template<std::size_t i, typename R >
decltype(auto) llvm::detail::get (const result_pair< R > &Pair)
 
template<typename R >
detail::enumerator< R > llvm::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 index of the item in the sequence, and B is the value from the original sequence. More...
 
template<typename Predicate , typename... Args>
bool llvm::detail::all_of_zip_predicate_first (Predicate &&P, Args &&...args)
 
template<typename... ArgsThenPredicate, size_t... InputIndexes>
bool llvm::detail::all_of_zip_predicate_last (std::tuple< ArgsThenPredicate... > argsThenPredicate, std::index_sequence< InputIndexes... >)
 
template<typename... ArgsAndPredicate>
bool llvm::all_of_zip (ArgsAndPredicate &&...argsAndPredicate)
 Compare two zipped ranges using the provided predicate (as last argument). More...
 
template<typename IterTy , typename Pred = bool (*)(const decltype(*std::declval<IterTy>()) &)>
bool llvm::hasNItems (IterTy &&Begin, IterTy &&End, unsigned N, Pred &&ShouldBeCounted=[](const decltype(*std::declval< IterTy >()) &) { return true;}, std::enable_if_t< !std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< std::remove_reference_t< decltype(Begin)>>::iterator_category >::value, void > *=nullptr)
 Return true if the sequence [Begin, End) has exactly N items. More...
 
template<typename IterTy , typename Pred = bool (*)(const decltype(*std::declval<IterTy>()) &)>
bool llvm::hasNItemsOrMore (IterTy &&Begin, IterTy &&End, unsigned N, Pred &&ShouldBeCounted=[](const decltype(*std::declval< IterTy >()) &) { return true;}, std::enable_if_t< !std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< std::remove_reference_t< decltype(Begin)>>::iterator_category >::value, void > *=nullptr)
 Return true if the sequence [Begin, End) has N or more items. More...
 
template<typename IterTy , typename Pred = bool (*)(const decltype(*std::declval<IterTy>()) &)>
bool llvm::hasNItemsOrLess (IterTy &&Begin, IterTy &&End, unsigned N, Pred &&ShouldBeCounted=[](const decltype(*std::declval< IterTy >()) &) { return true;})
 Returns true if the sequence [Begin, End) has N or less items. More...
 
template<typename ContainerTy >
bool llvm::hasNItems (ContainerTy &&C, unsigned N)
 Returns true if the given container has exactly N items. More...
 
template<typename ContainerTy >
bool llvm::hasNItemsOrMore (ContainerTy &&C, unsigned N)
 Returns true if the given container has N or more items. More...
 
template<typename ContainerTy >
bool llvm::hasNItemsOrLess (ContainerTy &&C, unsigned N)
 Returns true if the given container has N or less items. More...
 
template<class Ptr >
auto llvm::to_address (const Ptr &P)
 Returns a raw pointer that represents the same address as the argument. More...
 
template<class T >
constexpr Tllvm::to_address (T *P)
 

Variables

template<typename T >
int(*)(const void *, const void *) llvm::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 right. More...
 

Detailed Description

This file contains some templates that are useful if you are working with the STL at all.

No library is required when using these functions.

Definition in file STLExtras.h.