Index: llvm/include/llvm/ADT/STLExtras.h =================================================================== --- llvm/include/llvm/ADT/STLExtras.h +++ llvm/include/llvm/ADT/STLExtras.h @@ -1167,15 +1167,10 @@ C.clear(); } -/// Get the size of a range. This is a wrapper function around std::distance -/// which is only enabled when the operation is O(1). +/// Provide wrappers to std::distance which take ranges instead of having to +/// pass begin/end explicitly. template -auto size(R &&Range, typename std::enable_if< - std::is_same::iterator_category, - std::random_access_iterator_tag>::value, - void>::type * = nullptr) - -> decltype(std::distance(Range.begin(), Range.end())) { +auto size(R &&Range) -> decltype(std::distance(Range.begin(), Range.end())) { return std::distance(Range.begin(), Range.end()); }