Cogs.Core
Cogs.Foundation
Source
UniqueValue.h
1
#pragma once
2
3
namespace
Cogs
{
4
12
template
<
typename
T>
13
struct
UniqueValue
{
14
UniqueValue
() =
default
;
15
UniqueValue
(
const
T& value) : value(value) {}
16
UniqueValue
(
const
UniqueValue
&) =
delete
;
17
UniqueValue
(
UniqueValue
&& other) noexcept : value(other.value) { other.value = T(0); }
18
19
UniqueValue
& operator=(
const
UniqueValue
&) =
delete
;
20
UniqueValue
& operator=(
UniqueValue
&& other)
noexcept
{ value = other.value; other.value = T(0);
return
*
this
; }
21
22
T value = T(0);
23
};
24
25
}
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::UniqueValue
A value that is cleared when it is moved from.
Definition:
UniqueValue.h:13
Generated by
1.9.6