CatapultServer
v0.5.0.1 (Elephant)
ImmutableValue.h
Go to the documentation of this file.
1
21
#pragma once
22
#include "
NonCopyable.h
"
23
24
namespace
catapult
{
namespace
utils {
25
26
#pragma pack(push, 1)
27
29
template
<
typename
TValue>
30
class
ImmutableValue
:
public
utils::MoveOnly
{
31
public
:
33
constexpr
explicit
ImmutableValue
(TValue value) :
m_value
(value)
34
{}
35
36
public
:
38
constexpr
operator
const
TValue()
const
{
39
return
m_value
;
40
}
41
42
private
:
43
TValue
m_value
;
44
};
45
46
#pragma pack(pop)
47
}}
catapult::utils::ImmutableValue::ImmutableValue
constexpr ImmutableValue(TValue value)
Creates an immutable value around value.
Definition:
ImmutableValue.h:33
catapult::utils::ImmutableValue::m_value
TValue m_value
Definition:
ImmutableValue.h:43
catapult::utils::MoveOnly
A class that can be moved but not copied.
Definition:
NonCopyable.h:43
catapult::utils::ImmutableValue
A move-only value wrapper.
Definition:
ImmutableValue.h:30
catapult
Definition:
AddressExtractionExtension.cpp:28
NonCopyable.h
catapult-server
src
catapult
utils
ImmutableValue.h
Generated by
1.8.16