[libcxx-commits] [PATCH] D117714: [libc++] Implement LWG3549: view_interface need not inherit from view_base

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 20 10:20:34 PST 2022


Mordante added a comment.

Thanks for working on this.



================
Comment at: libcxx/include/__ranges/enable_view.h:32
+
+template <class _Tp> std::true_type __inherits_from_view_interface(view_interface<_Tp>*);
+std::false_type __inherits_from_view_interface(...);
----------------
Please use `is_derived` instead of `inherits`, the former matches the naming in the Standard `is-derived-from-view-interface`.


================
Comment at: libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp:21
 #include "test_macros.h"
 #include "test_iterators.h"
 
----------------
I miss new tests that validate the constrains set in LWG 3549
"For a type T, is-derived-from-view-interface<T> is true if and only if T has exactly one public base class view_interface<U> for some type U and T has no base classes of type view_interface<V> for any other type V."

For example
`struct NotAValidViewInterace : std::ranges::view_interface<InputRange>, std::ranges::view_interface<MoveOnlyForwardRange>{};`



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117714



More information about the libcxx-commits mailing list