Overloads Custom overloads of size may be provided for classes and enumerations that do not expose a suitable size () member function, yet can be detected. Overloads of size found by argument-dependent lookup can be used to customize the behavior of std::ranges::size, std::ranges::ssize, and std::ranges::empty.
The default implementation of size () member function obtains the size of the range by calculating the difference between the sentinel and the beginning iterator.
Notes size_t can store the maximum size of a theoretically possible object of any type (including array). size_t is commonly used for array indexing and loop counting. Programs that use other types, such as unsignedint, for array indexing may fail on, e.g. 64-bit systems when the index exceeds UINT_MAX or if it relies on 32-bit modular arithmetic.
Notes std::size_t can store the maximum size of a theoretically possible object of any type (including array). On many platforms (an exception is systems with segmented addressing) std::size_t can safely store the value of any non-member pointer, in which case it is synonymous with std::uintptr_t.
Buckshot, as its name suggests, is shot for bucks. A load of buckshot consists of a few very large pellets loaded into a shotgun shell. It works on bucks, and it works on does, too, of course. At ...