2022-02-03 08:45:34 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
|
|
|
|
NAMESPACE_REDCRAFT_BEGIN
|
|
|
|
NAMESPACE_MODULE_BEGIN(Redcraft)
|
|
|
|
NAMESPACE_MODULE_BEGIN(Utility)
|
|
|
|
|
2022-12-29 13:55:02 +00:00
|
|
|
/** A class indicates that a derived class cannot be copied. */
|
2022-02-03 08:45:34 +00:00
|
|
|
struct FNoncopyable
|
|
|
|
{
|
2022-02-03 14:25:02 +00:00
|
|
|
FNoncopyable() = default;
|
2022-02-03 08:45:34 +00:00
|
|
|
FNoncopyable(const FNoncopyable&) = delete;
|
|
|
|
FNoncopyable& operator=(const FNoncopyable&) = delete;
|
|
|
|
};
|
|
|
|
|
2022-12-29 13:55:02 +00:00
|
|
|
/** A class indicates that a derived class cannot be moved. */
|
2022-02-03 08:45:34 +00:00
|
|
|
struct FNonmovable
|
|
|
|
{
|
2022-02-03 14:25:02 +00:00
|
|
|
FNonmovable() = default;
|
2022-04-05 09:00:33 +00:00
|
|
|
FNonmovable(FNonmovable&&) = delete;
|
|
|
|
FNonmovable& operator=(FNonmovable&&) = delete;
|
2022-02-03 08:45:34 +00:00
|
|
|
};
|
|
|
|
|
2022-12-29 13:55:02 +00:00
|
|
|
/** A class indicates that a derived class cannot be copied or moved. */
|
2022-11-18 15:17:54 +00:00
|
|
|
struct FSingleton // : FNoncopyable, FNonmovable
|
|
|
|
{
|
2022-12-29 13:55:02 +00:00
|
|
|
// NOTE: Multiple inheritance is no longer used here, as that would break the EBO in MSVC
|
|
|
|
|
2022-11-18 15:17:54 +00:00
|
|
|
FSingleton() = default;
|
|
|
|
FSingleton(const FSingleton&) = delete;
|
|
|
|
FSingleton(FSingleton&&) = delete;
|
|
|
|
FSingleton& operator=(const FSingleton&) = delete;
|
|
|
|
FSingleton& operator=(FSingleton&&) = delete;
|
|
|
|
};
|
2022-02-03 08:45:34 +00:00
|
|
|
|
|
|
|
NAMESPACE_MODULE_END(Utility)
|
|
|
|
NAMESPACE_MODULE_END(Redcraft)
|
|
|
|
NAMESPACE_REDCRAFT_END
|