Iros
 
Loading...
Searching...
No Matches
exchange.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/util/forward.h"
4#include "di/util/move.h"
5
6namespace di::util {
7template<typename T, typename U = T>
8constexpr auto exchange(T& object, U&& new_value) -> T {
9 auto temp = util::move(object);
10 object = util::forward<U>(new_value);
11 return temp;
12}
13}
14
15namespace di {
16using util::exchange;
17}
Definition vocab.h:96
constexpr auto exchange(T &object, U &&new_value) -> T
Definition exchange.h:8
Definition zstring_parser.h:9