UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AllOf.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 "Templates/Invoke.h"
7
8
9namespace Algo
10{
18 template <typename RangeType>
19 [[nodiscard]] bool AllOf(const RangeType& Range)
20 {
21 for (const auto& Element : Range)
22 {
23 if (!Element)
24 {
25 return false;
26 }
27 }
28
29 return true;
30 }
31
40 template <typename RangeType, typename ProjectionType>
41 [[nodiscard]] bool AllOf(const RangeType& Range, ProjectionType Projection)
42 {
43 for (const auto& Element : Range)
44 {
45 if (!Invoke(Projection, Element))
46 {
47 return false;
48 }
49 }
50
51 return true;
52 }
53}
AUTORTFM_INFER UE_FORCEINLINE_HINT constexpr auto Invoke(FuncType &&Func, ArgTypes &&... Args) -> decltype(((FuncType &&) Func)((ArgTypes &&) Args...))
Definition Invoke.h:44
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
AUTORTFM_INFER constexpr auto Projection(Invocable0Type &&Invocable0, InvocableTypes &&... Invocables)
Definition Projection.h:108
Definition ParallelSort.h:13
bool AllOf(const RangeType &Range)
Definition AllOf.h:19