UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
EqualTo.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Concepts/SameAs.h"
7#include "UnrealTemplate.h"
8
16template <typename T = void>
18{
19 [[nodiscard]] UE_REWRITE constexpr bool operator()(const T& Lhs, const T& Rhs) const
20 {
21 if constexpr (requires { { Lhs == Rhs } -> UE::CSameAs<bool>; })
22 {
23 return Lhs == Rhs;
24 }
25 else
26 {
27 static_assert(sizeof(T) == 0, "Trying to use TEqualTo<T> where T doesn't have an appropriate operator== overload. Please add bool operator==(T, T), do not specialize TEqualTo.");
28 }
29 }
30};
31
32template <>
34{
35 template <typename T, typename U>
36 [[nodiscard]] UE_REWRITE constexpr bool operator()(T&& Lhs, U&& Rhs) const
37 {
38 if constexpr (requires { { Forward<T>(Lhs) == Forward<U>(Rhs) } -> UE::CSameAs<bool>; })
39 {
40 return Forward<T>(Lhs) == Forward<U>(Rhs);
41 }
42 else
43 {
44 static_assert(sizeof(T) == 0, "Trying to use TEqualTo<void> with types without an appropriate operator== overload. Please add bool operator==(T, U), do not specialize TEqualTo.");
45 }
46 }
47};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define UE_REWRITE
Definition Platform.h:747
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition SameAs.h:16
UE_REWRITE constexpr bool operator()(T &&Lhs, U &&Rhs) const
Definition EqualTo.h:36
Definition EqualTo.h:18
UE_REWRITE constexpr bool operator()(const T &Lhs, const T &Rhs) const
Definition EqualTo.h:19