feat(concept): add concepts that depend on templates such as Forward and add corresponding tests
This commit is contained in:
23
Redcraft.Utility/Source/Public/Concepts/Assignable.h
Normal file
23
Redcraft.Utility/Source/Public/Concepts/Assignable.h
Normal file
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreTypes.h"
|
||||
#include "Concepts/Common.h"
|
||||
#include "Templates/Templates.h"
|
||||
#include "TypeTraits/TypeTraits.h"
|
||||
|
||||
NAMESPACE_REDCRAFT_BEGIN
|
||||
NAMESPACE_MODULE_BEGIN(Redcraft)
|
||||
NAMESPACE_MODULE_BEGIN(Utility)
|
||||
|
||||
template <typename T, typename U>
|
||||
concept CAssignableFrom =
|
||||
TIsLValueReference<T>::Value &&
|
||||
CCommonReferenceWith<const typename TRemoveReference<T>::Type&, const typename TRemoveReference<U>::Type&> &&
|
||||
requires(T A, U&& B)
|
||||
{
|
||||
{ A = Forward<U>(B) } -> CSameAs<T>;
|
||||
};
|
||||
|
||||
NAMESPACE_MODULE_END(Utility)
|
||||
NAMESPACE_MODULE_END(Redcraft)
|
||||
NAMESPACE_REDCRAFT_END
|
Reference in New Issue
Block a user