diff --git a/Source/Engine/Core/Collections/ArrayExtensions.h b/Source/Engine/Core/Collections/ArrayExtensions.h index 788b31edb..2ae6da9c8 100644 --- a/Source/Engine/Core/Collections/ArrayExtensions.h +++ b/Source/Engine/Core/Collections/ArrayExtensions.h @@ -4,7 +4,7 @@ #include "../Collections/Array.h" #include "../Collections/Dictionary.h" -#include +#include "../Delegate.h" class ArrayExtensions; @@ -23,7 +23,6 @@ public: /// /// Gets the common key. /// - /// The key. FORCE_INLINE const TKey& GetKey() const { return _key; @@ -32,7 +31,6 @@ public: /// /// Gets the common key. /// - /// The key. FORCE_INLINE TKey GetKey() { return _key; @@ -52,7 +50,7 @@ public: /// The prediction function. Should return true for the target element to find. /// The index of the element or -1 if nothing found. template - static int32 IndexOf(const Array& obj, const std::function& predicate) + static int32 IndexOf(const Array& obj, const Function& predicate) { for (int32 i = 0; i < obj.Count(); i++) { @@ -71,7 +69,7 @@ public: /// The prediction function. /// True if any element in the collection matches the prediction, otherwise false. template - static bool Any(const Array& obj, const std::function& predicate) + static bool Any(const Array& obj, const Function& predicate) { for (int32 i = 0; i < obj.Count(); i++) { @@ -90,7 +88,7 @@ public: /// The prediction function. /// True if all elements in the collection matches the prediction, otherwise false. template - static int32 All(const Array& obj, const std::function& predicate) + static int32 All(const Array& obj, const Function& predicate) { for (int32 i = 0; i < obj.Count(); i++) { @@ -109,7 +107,7 @@ public: /// A function to extract the key for each element. /// The result collection with groups. template - static void GroupBy(const Array& obj, const std::function& keySelector, Array, AllocationType>& result) + static void GroupBy(const Array& obj, const Function& keySelector, Array, AllocationType>& result) { Dictionary> data(static_cast(obj.Count() * 3.0f)); for (int32 i = 0; i < obj.Count(); i++) diff --git a/Source/Engine/Foliage/FoliageType.cpp b/Source/Engine/Foliage/FoliageType.cpp index 785010c44..7d530dfed 100644 --- a/Source/Engine/Foliage/FoliageType.cpp +++ b/Source/Engine/Foliage/FoliageType.cpp @@ -130,7 +130,7 @@ void FoliageType::Serialize(SerializeStream& stream, const void* otherObj) SERIALIZE(Model); - const std::function IsValidMaterial = [](const ModelInstanceEntry& e) -> bool + const Function IsValidMaterial = [](const ModelInstanceEntry& e) -> bool { return e.Material; }; diff --git a/Source/Engine/Graphics/Models/SkeletonMapping.h b/Source/Engine/Graphics/Models/SkeletonMapping.h index ac2af245b..e3ec0c793 100644 --- a/Source/Engine/Graphics/Models/SkeletonMapping.h +++ b/Source/Engine/Graphics/Models/SkeletonMapping.h @@ -66,7 +66,7 @@ public: const auto parentModelIndex = node.ParentIndex; // Find matching node in skeleton (or map to best parent) - const std::function f = [node](const T& x) -> bool + const Function f = [node](const T& x) -> bool { return x.Name == node.Name; }; diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp index 1e086788e..0b857d394 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp @@ -578,7 +578,7 @@ void GPUDeviceVulkan::ParseOptionalDeviceExtensions(const Array& de const auto HasExtension = [&deviceExtensions](const char* name) -> bool { - const std::function CheckCallback = [&name](const char* const& extension) -> bool + const Function CheckCallback = [&name](const char* const& extension) -> bool { return StringUtils::Compare(extension, name) == 0; }; diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp index 6de1755dc..b4a6112a9 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp @@ -431,7 +431,7 @@ void DeferredDeletionQueueVulkan::EnqueueGenericResource(Type type, uint64 handl ScopeLock lock(_locker); #if BUILD_DEBUG - const std::function ContainsHandle = [handle](const Entry& e) + const Function ContainsHandle = [handle](const Entry& e) { return e.Handle == handle; }; @@ -1087,7 +1087,7 @@ GPUDevice* GPUDeviceVulkan::Create() const auto hasExtension = [](const Array& extensions, const char* name) -> bool { - const std::function callback = [&name](const char* const& extension) -> bool + const Function callback = [&name](const char* const& extension) -> bool { return extension && StringUtils::Compare(extension, name) == 0; }; diff --git a/Source/Engine/Tools/ModelTool/ModelTool.cpp b/Source/Engine/Tools/ModelTool/ModelTool.cpp index 15c7cbc32..9c9fb00a4 100644 --- a/Source/Engine/Tools/ModelTool/ModelTool.cpp +++ b/Source/Engine/Tools/ModelTool/ModelTool.cpp @@ -1474,7 +1474,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op // Group meshes that can be merged together typedef Pair MeshGroupKey; - const std::function f = [](MeshData* const& x) -> MeshGroupKey + const Function f = [](MeshData* const& x) -> MeshGroupKey { return MeshGroupKey(x->NodeIndex, x->MaterialSlotIndex); };