[libcxx-commits] [PATCH] D97162: [libcxx] adds std::ranges::swap, std::swappable, and std::swappable_with

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 3 22:55:33 PST 2021


cjdb added inline comments.


================
Comment at: libcxx/include/concepts:309
+    {
+      __y = _VSTD::exchange(__x, std::move(__y));
+    }
----------------
Quuxplusone wrote:
> cjdb wrote:
> > miscco wrote:
> > > While this is what the standard says, it boils down to the conventional swap implementation, which is better known. So should we simply avoid the function call and directly open code `swap`?
> > I'd prefer to faithfully follow the standard and trust an optimising compiler will deal with this appropriately :-)
> IMO yes; and also `std::move` should be `_VSTD::move`.
`_VSTD::move` done, but I'd still prefer to follow the standard wording.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97162



More information about the libcxx-commits mailing list