Files
Reboot-Launcher/dependencies/reboot/Project Reboot 3.0/ReversePredicate.h
Alessandro Autiero b41e22adeb <feat: New project structure>
<feat: New release>
2023-09-02 15:34:15 +02:00

21 lines
432 B
C++

#pragma once
#include "UnrealTemplate.h"
/**
* Helper class to reverse a predicate.
* Performs Predicate(B, A)
*/
template <typename PredicateType>
class TReversePredicate
{
const PredicateType& Predicate;
public:
TReversePredicate(const PredicateType& InPredicate)
: Predicate(InPredicate)
{}
template <typename T>
FORCEINLINE bool operator()(T&& A, T&& B) const { return Predicate(Forward<T>(B), Forward<T>(A)); }
};