Skip to content

GB274 24.02 Add range_size_t LWG 3335 #270

@wg21bot

Description

@wg21bot

Add range_size_t
LEWG asked that range_size_t be removed from P1035, as they were doing a good job of being neutral w.r.t whether or not size-types were signed or unsigned at the time.
Now that we've got a policy on what size-types are, and that P1522 and P1523 have been adopted, it makes sense for there to be a range_size_t.

Proposed change:
Add to [ranges.syn]:

  template<range R>
  using range_difference_t = iter_difference_t<iterator_t<R>>;
 template<sized_range R>
   using range_size_t = decltype(ranges::size(declval<R&>()));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions