Redcraft/Redcraft.Utility/Source/Public/Concepts/Convertible.h

16 lines
389 B
C++

#pragma once
#include "CoreTypes.h"
#include "TypeTraits/TypeTraits.h"
NAMESPACE_REDCRAFT_BEGIN
NAMESPACE_MODULE_BEGIN(Redcraft)
NAMESPACE_MODULE_BEGIN(Utility)
template <typename T, typename U>
concept CConvertibleTo = TIsConvertible<T, U>::Value && requires(T(&Func)()) { static_cast<U>(Func()); };
NAMESPACE_MODULE_END(Utility)
NAMESPACE_MODULE_END(Redcraft)
NAMESPACE_REDCRAFT_END