2022-02-02 19:04:42 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
#include "Concepts/Convertible.h"
|
2022-02-04 15:47:57 +08:00
|
|
|
#include "TypeTraits/TypeTraits.h"
|
|
|
|
#include "Concepts/Destructible.h"
|
2022-02-02 19:04:42 +08:00
|
|
|
|
|
|
|
#include <new>
|
|
|
|
|
|
|
|
NAMESPACE_REDCRAFT_BEGIN
|
|
|
|
NAMESPACE_MODULE_BEGIN(Redcraft)
|
|
|
|
NAMESPACE_MODULE_BEGIN(Utility)
|
|
|
|
|
|
|
|
template <typename T, typename... Args>
|
2022-05-16 22:42:17 +08:00
|
|
|
concept CConstructibleFrom = CDestructible<T> && CConstructible<T, Args...>;
|
2022-02-02 19:04:42 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
concept CDefaultInitializable = CConstructibleFrom<T> && requires { T{}; ::new(static_cast<void*>(nullptr)) T; };
|
|
|
|
|
|
|
|
NAMESPACE_MODULE_END(Utility)
|
|
|
|
NAMESPACE_MODULE_END(Redcraft)
|
|
|
|
NAMESPACE_REDCRAFT_END
|