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

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 21 17:34:43 PST 2022


Quuxplusone accepted this revision as: Quuxplusone.
Quuxplusone added a comment.

LGTM! Please wait for @ldionne or @mordante to take a look too.



================
Comment at: libcxx/include/__ranges/view_interface.h:21
 #include <__ranges/empty.h>
 #include <__ranges/enable_view.h>
 #include <concepts>
----------------
Pre-existing but perhaps relevant: This line can be eliminated.


================
Comment at: libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp:82-84
+struct MultipleInheritanceViewInterface : std::ranges::view_interface<InputRange>, std::ranges::view_interface<MoveOnlyForwardRange> {
+};
+static_assert(!std::ranges::view<MultipleInheritanceViewInterface>);
----------------
Please do something to fix the long line. I suggest `s/MultipleInheritanceViewInterface/MI/g`.
(Also, wasn't this supposed to be landed as part of D117918? Too late now, anyway.)



================
Comment at: libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp:309
+struct V2 : std::ranges::view_interface<V2> { V1 base_; };
+static_assert(sizeof(V2) == sizeof(V1));
+
----------------
Arguably this should be `LIBCPP_STATIC_ASSERT` since this behavior is not //mandated//; but every other vendor has already beaten us to implement this, so I think a plain `static_assert` is fine.


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