Return the number of elements in Range.

Synopsis

Declared in <llvm/ADT/STLExtras.h>

template<typename R>
constexpr
size_t
range_size(R&& Range);

Description

This implementation takes inspiration from std::ranges::size from C++20 and delegates the size check to adl_size or std::distance, in this order of preference. Unlike llvm::size, this function does not guarantee O(1) running time, and is intended to be used in generic code that does not know the exact range type.

Return Value

The number of elements in Range.

Parameters

Name

Description

Range

Range whose size is computed.

Created with MrDocs