[libcxx-commits] [PATCH] D64234: Make swap functions constexpr

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 4 21:33:32 PDT 2019


zoecarver created this revision.
zoecarver added reviewers: mclow.lists, EricWF, ldionne.
Herald added subscribers: libcxx-commits, dexonsmith.

This patch makes swap functions constexpr. This patch does not implement all of P0879R0 <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0879r0.html> for two reasons a) to make this patch easier to review and b) because `std::swap` being a constexpr disproportionately helps when implementing other papers. Both `swap` overloads, `swap_ranges` and `iter_swap` are updated (with tests).


Repository:
  rCXX libc++

https://reviews.llvm.org/D64234

Files:
  include/type_traits
  include/utility
  test/std/algorithms/alg.modifying.operations/alg.swap/iter_swap.pass.cpp
  test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp
  test/std/utilities/utility/utility.swap/swap.pass.cpp
  test/std/utilities/utility/utility.swap/swap_array.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64234.208114.patch
Type: text/x-patch
Size: 4868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190705/5eb3742e/attachment-0001.bin>


More information about the libcxx-commits mailing list