style(*): add comments and attribute specifiers

This commit is contained in:
2022-12-29 21:55:02 +08:00
parent b75cb30f4f
commit 9368a49806
15 changed files with 916 additions and 268 deletions

View File

@ -6,6 +6,7 @@ NAMESPACE_REDCRAFT_BEGIN
NAMESPACE_MODULE_BEGIN(Redcraft)
NAMESPACE_MODULE_BEGIN(Utility)
/** A class indicates that a derived class cannot be copied. */
struct FNoncopyable
{
FNoncopyable() = default;
@ -13,6 +14,7 @@ struct FNoncopyable
FNoncopyable& operator=(const FNoncopyable&) = delete;
};
/** A class indicates that a derived class cannot be moved. */
struct FNonmovable
{
FNonmovable() = default;
@ -20,9 +22,11 @@ struct FNonmovable
FNonmovable& operator=(FNonmovable&&) = delete;
};
// Multiple inheritance is no longer used here, as that would break the EBO in MSVC
/** A class indicates that a derived class cannot be copied or moved. */
struct FSingleton // : FNoncopyable, FNonmovable
{
// NOTE: Multiple inheritance is no longer used here, as that would break the EBO in MSVC
FSingleton() = default;
FSingleton(const FSingleton&) = delete;
FSingleton(FSingleton&&) = delete;