[libcxx-commits] [PATCH] D125156: [libc++][ranges] Implement `views::drop`.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 6 23:00:14 PDT 2022


var-const added inline comments.


================
Comment at: libcxx/include/__ranges/drop_view.h:259
+    {
+      auto clamped = std::min<_Dist>(ranges::distance(__rng), std::forward<_Np>(__n));
+      return          _RawRange(
----------------
Not sure if this is worth making the actual implementation differ from the expressions in the return type and the `noexcept` clause. Calculating `std::min` twice seems wasteful (though I guess it should be easily optimized by the compiler?).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125156



More information about the libcxx-commits mailing list