[libcxx-commits] [PATCH] D112631: [libc++][test] Fix invalid test for views::view_interface

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 27 09:34:57 PDT 2021


cjdb added a comment.

Nice catch, thanks.

I think a conforming implementation is allowed to put those two requirements on each of the member functions: WDYT about adding that in this patch?



================
Comment at: libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp:105
   constexpr RAIter begin() const { return RAIter(const_cast<int*>(buff)); }
   constexpr RAIter end() const { return RAIter(const_cast<int*>(buff) + 8); }
 };
----------------
I don't mind if it's done in this patch or a second one, but could you please strip the const_casts? A const-qualified range shouldn't be returning a mutable iterator.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112631



More information about the libcxx-commits mailing list