MCRO
C++23 utilities for Unreal Engine.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
w
x
z
Variables
a
i
k
p
s
t
Typedefs
f
i
t
Enumerations
Concepts
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
v
w
~
Functions
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
w
~
Variables
a
b
c
d
e
f
h
i
m
n
o
p
r
s
t
v
w
Typedefs
a
b
c
d
e
f
i
m
p
r
s
t
v
w
Enumerations
Enumerator
Related Symbols
g
o
Files
File List
Globals
All
_
a
b
d
e
f
g
i
l
m
n
o
p
s
t
u
w
Functions
b
d
e
g
o
s
Typedefs
Macros
_
a
e
f
i
l
m
n
p
s
t
u
w
▼
MCRO
Who is this library for?
►
What MCRO can do?
Legal
►
Attribution
►
Bitter Recompense
Todo List
►
Namespaces
►
Concepts
►
Data Structures
▼
Files
▼
File List
►
Docs
►
Private
▼
Public
▼
Mcro
►
Delegates
►
Error
►
LibraryIncludes
►
Range
►
Rendering
►
Text
►
UObjects
►
Any.h
►
ArrayViews.h
►
AssertMacros.h
►
AutoModularFeature.h
►
Badge.h
Common.h
CommonCore.h
►
Composition.h
►
Concepts.h
►
ConstexprXXH3.h
►
Construct.h
►
Dll.h
►
Enums.h
►
Error.Fwd.h
►
Error.h
►
Finally.h
►
FmtMacros.h
►
FunctionTraits.h
►
InitializeOnCopy.h
►
Macros.h
►
Modules.h
►
Observable.Fwd.h
►
Observable.h
►
Once.h
►
Platform.h
►
Range.h
►
SharedObjects.h
►
Slate.h
►
Subsystems.h
►
Templates.h
►
Text.h
►
TextMacros.h
►
Threading.h
►
TimespanLiterals.h
►
Tuples.h
►
TypeName.h
►
Types.h
►
Void.h
►
Yaml.h
►
Zero.h
►
Globals
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
InitializeOnCopy.h
Go to the documentation of this file.
1
/** @noop License Comment
2
* @file
3
* @copyright
4
* This Source Code is subject to the terms of the Mozilla Public License, v2.0.
5
* If a copy of the MPL was not distributed with this file You can obtain one at
6
* https://mozilla.org/MPL/2.0/
7
*
8
* @author David Mórász
9
* @date 2025
10
*/
11
12
#pragma once
13
14
#include "CoreMinimal.h"
15
#include "
Mcro/FunctionTraits.h
"
16
17
namespace
Mcro::InitializeOnCopy
18
{
19
using namespace
Mcro::FunctionTraits
;
20
21
/**
22
* @brief
23
* A type wrapper around a default initializeable object which may not be copyable but which needs to be a member
24
* of a copyable class. On each instance of such class the wrapped value may not need to be copied and default
25
* constructing it is enough. Useful for mutexes for example.
26
*/
27
template
<CDefaultInitializable T>
28
requires
(!CCopyable<T>)
29
struct
TInitializeOnCopy
30
{
31
TInitializeOnCopy
() : Value() {}
32
TInitializeOnCopy
(
TInitializeOnCopy
const
&) : Value() {}
33
TInitializeOnCopy
(
TInitializeOnCopy
&&) noexcept : Value() {}
34
auto
operator=
(
TInitializeOnCopy
const
&) ->
TInitializeOnCopy
& {
return
*
this
; }
35
auto
operator=
(
TInitializeOnCopy
&& other)
noexcept
->
TInitializeOnCopy
& {
return
*
this
; }
36
37
TUniqueObj<T>
Value
;
38
39
T* operator -> () {
return
&Value.Get(); }
40
const
T* operator -> ()
const
{
return
&Value.Get(); }
41
42
T&
Get
() {
return
Value.Get(); }
43
const
T&
Get
()
const
{
return
Value.Get(); }
44
45
template
<
typename
Self>
46
operator
typename
TCopyQualifiersFromTo<Self, T&>::Type (
this
Self&& self) {
return
self.Get(); }
47
};
29
struct
TInitializeOnCopy
{
…
};
48
}
17
namespace
Mcro::InitializeOnCopy
{
…
}
FunctionTraits.h
Mcro::FunctionTraits
Definition
FunctionTraits.h:22
Mcro::InitializeOnCopy
Definition
InitializeOnCopy.h:18
Mcro::InitializeOnCopy::TInitializeOnCopy
A type wrapper around a default initializeable object which may not be copyable but which needs to be...
Definition
InitializeOnCopy.h:30
Mcro::InitializeOnCopy::TInitializeOnCopy::Get
const T & Get() const
Definition
InitializeOnCopy.h:43
Mcro::InitializeOnCopy::TInitializeOnCopy::TInitializeOnCopy
TInitializeOnCopy(TInitializeOnCopy &&) noexcept
Definition
InitializeOnCopy.h:33
Mcro::InitializeOnCopy::TInitializeOnCopy::operator=
auto operator=(TInitializeOnCopy &&other) noexcept -> TInitializeOnCopy &
Definition
InitializeOnCopy.h:35
Mcro::InitializeOnCopy::TInitializeOnCopy::Get
T & Get()
Definition
InitializeOnCopy.h:42
Mcro::InitializeOnCopy::TInitializeOnCopy::TInitializeOnCopy
TInitializeOnCopy()
Definition
InitializeOnCopy.h:31
Mcro::InitializeOnCopy::TInitializeOnCopy::Value
TUniqueObj< T > Value
Definition
InitializeOnCopy.h:37
Mcro::InitializeOnCopy::TInitializeOnCopy::operator=
auto operator=(TInitializeOnCopy const &) -> TInitializeOnCopy &
Definition
InitializeOnCopy.h:34
Mcro::InitializeOnCopy::TInitializeOnCopy::TInitializeOnCopy
TInitializeOnCopy(TInitializeOnCopy const &)
Definition
InitializeOnCopy.h:32
Public
Mcro
InitializeOnCopy.h
Generated by
1.12.0