[libcxx-commits] [PATCH] D157171: [libc++] mdspan - implement layout_stride

Christian Trott via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 17 08:59:58 PDT 2023


crtrott marked 15 inline comments as done.
crtrott added inline comments.


================
Comment at: libcxx/include/__mdspan/layout_stride.h:227
+    _LIBCPP_ASSERT(([&]<size_t... _Pos>(index_sequence<_Pos...>) {
+                     return static_cast<index_type>(0) == static_cast<index_type>(__other((_Pos ? 0 : 0)...));
+                   }(make_index_sequence<__rank_>())),
----------------
philnik wrote:
> Maybe?
Results in warning: `include/c++/v1/__mdspan/layout_stride.h:322:49: error: left operand of comma operator has no effect [-Werror,-Wunused-value]`


================
Comment at: libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp:83
+    // but the product is not, so we can't use it for layout_stride
+    TEST_LIBCPP_ASSERT_FAILURE(
+        ([=] { std::layout_stride::template mapping<std::extents<char, D, 5>> m(arg); }()),
----------------
philnik wrote:
> Possible future work: Add tests to make sure that `mdspan` and friends work with `_BitInt`.
Will do this in a future revision for all the relevant pieces starting with extents.


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

https://reviews.llvm.org/D157171



More information about the libcxx-commits mailing list