2022-02-02 11:04:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
#include "Concepts/Convertible.h"
|
2022-02-04 07:47:57 +00:00
|
|
|
#include "TypeTraits/TypeTraits.h"
|
|
|
|
#include "Concepts/Destructible.h"
|
2022-02-02 11:04:42 +00:00
|
|
|
|
|
|
|
#include <new>
|
|
|
|
|
|
|
|
NAMESPACE_REDCRAFT_BEGIN
|
|
|
|
NAMESPACE_MODULE_BEGIN(Redcraft)
|
|
|
|
NAMESPACE_MODULE_BEGIN(Utility)
|
|
|
|
|
|
|
|
template <typename T, typename... Args>
|
|
|
|
concept CConstructibleFrom = CDestructible<T> && TIsConstructible<T, Args...>::Value;
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
concept CDefaultInitializable = CConstructibleFrom<T> && requires { T{}; ::new(static_cast<void*>(nullptr)) T; };
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
concept CMoveConstructible = CConstructibleFrom<T, T> && CConvertibleTo<T, T>;
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
concept CCopyConstructible = CMoveConstructible<T> &&
|
|
|
|
CConstructibleFrom<T, T&> && CConvertibleTo<T&, T> &&
|
|
|
|
CConstructibleFrom<T, const T&> && CConvertibleTo<const T&, T> &&
|
|
|
|
CConstructibleFrom<T, const T> && CConvertibleTo<const T, T>;
|
|
|
|
|
|
|
|
NAMESPACE_MODULE_END(Utility)
|
|
|
|
NAMESPACE_MODULE_END(Redcraft)
|
|
|
|
NAMESPACE_REDCRAFT_END
|