llvm::size

Return the size of Range when distance is O(1).

Synopsis

Declared in <llvm/ADT/STLExtras.h>

template<typename R>
auto
size(R&& Range)
requires std::is_base_of<std::random_access_iterator_tag,
                              typename std::iterator_traits<decltype(
                                  Range.begin())>::iterator_category>::value;

Description

This is a wrapper around std::distance which is only enabled when the operation is O(1).

Return Value

The number of elements in Range.

Parameters

NameDescription
RangeRandom-access range whose size is computed.