Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
DontCopy.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6
7// Can be used as a wrapper over non-copyable objects (i.e. FCriticalSection) if you still want the class containing your
8// object to keep its copyable property without compromising integrity of the object that doesn't support being copied.
9// It makes each TDontCopy member of a class an exclusive entity of that class.
10
11template <typename T>
13{
14 TDontCopy() = default;
15 ~TDontCopy() = default;
18 TDontCopy& operator=(TDontCopy&&) { return *this; }
19 TDontCopy& operator=(const TDontCopy&) { return *this; }
20
21 T& Get() { return Value; }
22 const T& Get() const { return Value; }
23
24 T* operator->() { return &Value; }
25 const T* operator->() const { return &Value; }
26
27 T& operator*() { return Value; }
28 const T& operator*() const { return Value; }
29
30private:
32};
T & operator*()
Definition DontCopy.h:27
T & Get()
Definition DontCopy.h:21
const T & Get() const
Definition DontCopy.h:22
T * operator->()
Definition DontCopy.h:24
TDontCopy(TDontCopy &&)
Definition DontCopy.h:16
const T & operator*() const
Definition DontCopy.h:28
TDontCopy(const TDontCopy &)
Definition DontCopy.h:17
~TDontCopy()=default
TDontCopy & operator=(TDontCopy &&)
Definition DontCopy.h:18
const T * operator->() const
Definition DontCopy.h:25
TDontCopy & operator=(const TDontCopy &)
Definition DontCopy.h:19
TDontCopy()=default