refactor(typetraits): replaces template class type traits with concepts for TypeTraits/CompositeType.h

This commit is contained in:
2022-05-15 23:10:02 +08:00
parent 1dcd3dc3b3
commit 22fe906eda
10 changed files with 59 additions and 73 deletions

View File

@ -88,13 +88,13 @@ constexpr T Exchange(T& A, U&& B)
template <typename T>
constexpr T&& DeclVal();
template <typename T> requires TIsObject<T>::Value
template <typename T> requires CObject<T>
constexpr T* AddressOf(T& Object)
{
return reinterpret_cast<T*>(&const_cast<char&>(reinterpret_cast<const volatile char&>(Object)));
}
template <typename T> requires (!TIsObject<T>::Value)
template <typename T> requires (!CObject<T>)
constexpr T* AddressOf(T& Object)
{
return &Object;