[libcxx-commits] [PATCH] D128400: [libc++][NFC] Replace enable_if with __enable_if_t in a few places

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 30 05:38:44 PDT 2022


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

LGTM with comments applied.



================
Comment at: libcxx/include/__tree:1285
     pair<iterator, bool> __insert_unique(_Vp&& __v) {
-        return __emplace_unique(_VSTD::forward<_Vp>(__v));
     }
----------------
This (and line 1295) makes the indentation inconsistent in the file. Please keep the 4 space indentation for consistency.


================
Comment at: libcxx/include/array:435
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-typename enable_if
-<
-    _Size == 0 ||
-    __is_swappable<_Tp>::value,
-    void
->::type
+__enable_if_t<_Size == 0 || __is_swappable<_Tp>::value>
 swap(array<_Tp, _Size>& __x, array<_Tp, _Size>& __y)
----------------
Here and in other return types where you did the same transformation, please keep the explicit `void` type at the end. I know it's redundant, but it helps to see what is the intended return type of the function. We should also refactor these `enable_if`s to use template parameters instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128400



More information about the libcxx-commits mailing list