UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Less.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
17template <typename T /*= void */>
18struct TLess
19{
20 [[nodiscard]] UE_REWRITE constexpr bool operator()(const T& A, const T& B) const
21 {
22 if constexpr (requires { { A < B } -> UE::CSameAs<bool>; })
23 {
24 return A < B;
25 }
26 else
27 {
28 static_assert(sizeof(T) == 0, "Trying to use TLess<T> where T doesn't have an appropriate operator< overload. Please add bool operator<(T, T), do not specialize TLess.");
29 }
30 }
31};
32
33template <>
34struct TLess<void>
35{
36 template <typename T, typename U>
37 [[nodiscard]] UE_REWRITE constexpr bool operator()(T&& A, U&& B) const
38 {
39 if constexpr (requires { { Forward<T>(A) < Forward<U>(B) } -> UE::CSameAs<bool>; })
40 {
41 return Forward<T>(A) < Forward<U>(B);
42 }
43 else
44 {
45 static_assert(sizeof(T) == 0, "Trying to use TLess<void> with types without an appropriate operator< overload. Please add bool operator<(T, U), do not specialize TLess.");
46 }
47 }
48};
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 &&A, U &&B) const
Definition Less.h:37
Definition Less.h:19
UE_REWRITE constexpr bool operator()(const T &A, const T &B) const
Definition Less.h:20