A constexpr exchange function. More...
Go to the source code of this file.
Functions | |
| template<class T, class U = T> | |
| constexpr T | ugmisc::xchg (T &object, U &&new_value) |
A constexpr exchange function.
In C++17 this provides an alternative to std::exchange which is constexpr. In C++20 this just forwards its arguments to std::exchange, which is constexpr anyway.
Definition in file xchg.hpp.
|
constexpr |