https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116399

--- Comment #18 from 康桓瑋 <hewillk at gmail dot com> ---
> The random-access-non-sized ranges in the standard are currently only
> infinite ranges such as views::iota(0). Random access is useful for these
> ranges because we can random access any place without worrying about
> out-of-bounds.
> 
> However, for random-access-non-infinite ranges, only simply providing random
> access does not seem to be of much use, because we always need to know its
> size via ranges::distance before performing random access operations to
> avoid out-of-bounds.

If we always need to do O(n) to get the size before any random-access
operation, why provide random-access in the first place? Wouldn't it be more
efficient to just provide only forward operations like std::chrono::tzdb_list
does?

Reply via email to