[libcxx-commits] [PATCH] D101737: [libcxx] Implement view.interface.
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 1 11:00:56 PDT 2021
zoecarver marked 8 inline comments as done.
zoecarver added inline comments.
================
Comment at: libcxx/include/__ranges/view_interface.h:49
+ [[nodiscard]] constexpr bool empty()
+ noexcept(noexcept(ranges::begin(__derived()) == ranges::end(__derived())))
+ requires forward_range<_D2>
----------------
CaseyCarter wrote:
> You're missing that the implicit conversion to of this expression to `bool` could be potentially throwing. We use something like:
> ```c++
> template <class T>
> void implicit_convert_to(type_identity_t<T>) noexcept;
> /* ... */
> noexcept(noexcept(implicit_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived()))))
> ```
Done and added a regression test.
================
Comment at: libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp:184
+
+// TODO: why is the child member picked?
+// assert(ranges::data(dataNull) == nullptr);
----------------
ldionne wrote:
> Can you elaborate on what this TODO means?
No longer applies, removed.
(IIRC, that assert failed because it was using `view_interface`'s implementation for data.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101737/new/
https://reviews.llvm.org/D101737
More information about the libcxx-commits
mailing list