[libcxx-commits] [PATCH] D103734: [libcxx][modularisation] moves <utility> content out of <type_traits>

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 22 14:16:15 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/__algorithm/swap_ranges.h:27
+#ifndef _LIBCPP_CXX03_LANG
+    typename enable_if<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>::type
+#else
----------------
ldionne wrote:
> This forward declaration isn't using the `__swap_result_t` you factored out. I think you should include `__utility/swap.h` here.
Since `std::swap` is implemented in terms of `std::swap_ranges`, which itself is implemented in terms of `std::swap`, I think both of them should go into the same helper header. In main right now, that header is `<type_traits>`. I don't object to the idea of pulling them out into a single helper header, e.g. `__utility/swap.h`; but they ought to stay together, because cyclic dependency. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103734



More information about the libcxx-commits mailing list