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
6
namespace
di::util
{
7
template
<
typename
T,
typename
U = T>
8
constexpr
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
15
namespace
di
{
16
using
util::exchange
;
17
}
forward.h
di::util
Definition
vocab.h:96
di::util::exchange
constexpr auto exchange(T &object, U &&new_value) -> T
Definition
exchange.h:8
di
Definition
zstring_parser.h:9
move.h
libs
di
include
di
util
exchange.h
Generated by
1.13.0