[libcxx-commits] [PATCH] D106916: [libc++] Handle arrays in std::destroy_at

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 28 07:44:50 PDT 2021


ldionne marked 2 inline comments as done.
ldionne added inline comments.


================
Comment at: libcxx/include/__memory/construct_at.h:61
+#if _LIBCPP_STD_VER > 17
+template <class _Tp, class = void, class = _EnableIf<is_array_v<_Tp>>>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
----------------
Quuxplusone wrote:
> Instead of using this `class = void` hack, could you just use
> ```
> template <class _Tp, _EnableIf<!is_array_v<_Tp>, int> = 0>
> ```
> in the first case and
> ```
> template <class _Tp, _EnableIf<is_array_v<_Tp>, int> = 0>
> ```
> in the second case?
Indeed. For some reason I've never liked that trick, but it's not a rational preference. Switched.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106916



More information about the libcxx-commits mailing list