[libcxx-commits] [PATCH] D112665: [libc++] Ensure valid view for view_interface template parameter
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Oct 28 12:38:42 PDT 2021
Mordante accepted this revision as: Mordante.
Mordante added a comment.
LGTM module my two issues. I'll approve so @Quuxplusone can give the final approval after the remaining issues are solved.
================
Comment at: libcxx/include/__ranges/view_interface.h:46
constexpr _Derived& __derived() noexcept {
+ static_assert(requires { sizeof(_Derived); } && derived_from<_Derived, view_interface<_Derived>> && view<_Derived>, "The derived type must model derived_from<view_interface<D>> and view");
return static_cast<_Derived&>(*this);
----------------
Two points:
- I think it would be good to add comment why you use `requires { sizeof(_Derived); }` instead of `sizeof(_Derived);`
- I don't feel the message of the `static_assert` adds a lot of value. It basically says the same as the code, except that the code requires a complete type and the message doesn't mention it. I would prefer to remove the entire message.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112665/new/
https://reviews.llvm.org/D112665
More information about the libcxx-commits
mailing list