[libcxx-commits] [PATCH] D106923: [libcxx][ranges] Add `views::counted` CPO.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 30 14:59:56 PDT 2021


zoecarver added inline comments.


================
Comment at: libcxx/include/__ranges/counted.h:47
+    {
+      return span(_VSTD::to_address(_VSTD::forward<_Iter>(__it)), static_cast<iter_difference_t<_Iter>>(__c));
+    }
----------------
tcanens wrote:
> Why the `static_cast` to the same type?
> 
> The forward is also unnecessary - the `to_address` overload for non-pointers should take by const& anyway.
Now that the second parameter is a template type parameter type I'm going to keep the static_cast. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106923/new/

https://reviews.llvm.org/D106923



More information about the libcxx-commits mailing list