This is an archive of the discontinued LLVM Phabricator instance.

Make swap functions constexpr
ClosedPublic

Authored by zoecarver on Jul 4 2019, 9:31 PM.

Details

Summary

This patch makes swap functions constexpr. This patch does not implement all of P0879R0 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).

Diff Detail

Event Timeline

zoecarver created this revision.Jul 4 2019, 9:31 PM
EricWF accepted this revision.Jul 5 2019, 11:40 AM

Nicely done.

Thanks for the patch.

This revision is now accepted and ready to land.Jul 5 2019, 11:40 AM
zoecarver closed this revision.Jul 5 2019, 1:15 PM

Committed as rL365238.