[libcxx-commits] [PATCH] D118938: [libc++] Implement P1007R3: std::assume_aligned

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 8 13:41:01 PDT 2022


philnik accepted this revision.
philnik added a comment.
This revision is now accepted and ready to land.

LGTM % nit



================
Comment at: libcxx/include/__memory/assume_aligned.h:37
+  } else {
+    _LIBCPP_ASSERT((uintptr_t)__ptr % _Np == 0, "Alignment assumption is violated");
+    return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Np));
----------------
I think I'd like a `reinterpret_cast` here a bit more. At least say that you're an evil person.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118938



More information about the libcxx-commits mailing list