diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 32b052e976e..f0fe4fd9438 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -17,7 +17,6 @@ #define LLVM_ADT_STLEXTRAS_H #include "llvm/ADT/Optional.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" #include "llvm/Config/abi-breaking.h" @@ -51,10 +50,6 @@ namespace detail { template using IterOfRange = decltype(std::begin(std::declval())); -template -using ValueOfRange = typename std::remove_reference()))>::type; - } // end namespace detail //===----------------------------------------------------------------------===// @@ -1334,15 +1329,6 @@ bool is_splat(R &&Range) { std::equal(adl_begin(Range) + 1, adl_end(Range), adl_begin(Range))); } -/// Given a range of type R, iterate the entire range and return a -/// SmallVector with elements of the vector. This is useful, for example, -/// when you want to iterate a range and then sort the results. -template -SmallVector>::type, Size> -to_vector(R &&Range) { - return {adl_begin(Range), adl_end(Range)}; -} - /// Provide a container algorithm similar to C++ Library Fundamentals v2's /// `erase_if` which is equivalent to: /// diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 17586904d21..8c46aa90690 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -907,6 +907,17 @@ inline size_t capacity_in_bytes(const SmallVector &X) { return X.capacity_in_bytes(); } +/// Given a range of type R, iterate the entire range and return a +/// SmallVector with elements of the vector. This is useful, for example, +/// when you want to iterate a range and then sort the results. +template +SmallVector()))>::type>::type, + Size> +to_vector(R &&Range) { + return {std::begin(Range), std::end(Range)}; +} + } // end namespace llvm namespace std {