[libcxx-commits] [PATCH] D154367: [libc++] mdspan - implement mdspan class

Christian Trott via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 22 10:21:19 PDT 2023


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


================
Comment at: libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp:12
+
+// constexpr mdspan(const mdspan&) = default;
+//
----------------
ldionne wrote:
> This synopsis is wrong, please go through them to make sure.
I think this is right?


================
Comment at: libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp:34-39
+  // The defaulted assignment operator seems to be deprecated because:
+  //   error: definition of implicit copy assignment operator for 'checked_accessor<const double>' is deprecated
+  //   because it has a user-provided copy constructor [-Werror,-Wdeprecated-copy-with-user-provided-copy]
+  if constexpr (!std::is_same_v<A, checked_accessor<const double>>)
+    m = m_org;
+  // even though the following checks out:
----------------
ldionne wrote:
> I think you can get rid of this by using a `= default` copy assignment operator. In all cases I don't understand why we're basically not testing anything in that case.
part of the point of checked accessor is to NOT be trivially copy assignable, so that's why it has a user provided one. 


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

https://reviews.llvm.org/D154367



More information about the libcxx-commits mailing list