From 5439efc5591e1ef1813ceff5c79cb71da7d64989 Mon Sep 17 00:00:00 2001
From: Mateusz Karbowiak <69864511+mtszkarbowiak@users.noreply.github.com>
Date: Wed, 30 Oct 2024 22:29:26 +0100
Subject: [PATCH] Collections implicit cast constructor fix
This one prohibits annoying casts. It is also important for future context injection and follows STL practice.
---
Source/Engine/Core/Collections/Array.h | 2 +-
Source/Engine/Core/Collections/BitArray.h | 2 +-
Source/Engine/Core/Collections/Dictionary.h | 2 +-
Source/Engine/Core/Collections/HashSet.h | 2 +-
Source/Engine/Renderer/RenderListBuffer.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Source/Engine/Core/Collections/Array.h b/Source/Engine/Core/Collections/Array.h
index f60d0dec1..e096992f8 100644
--- a/Source/Engine/Core/Collections/Array.h
+++ b/Source/Engine/Core/Collections/Array.h
@@ -52,7 +52,7 @@ public:
/// Initializes a new instance of the class.
///
/// The initial capacity.
- Array(int32 capacity)
+ explicit Array(int32 capacity)
: _count(0)
, _capacity(capacity)
{
diff --git a/Source/Engine/Core/Collections/BitArray.h b/Source/Engine/Core/Collections/BitArray.h
index c62362780..70d51bac0 100644
--- a/Source/Engine/Core/Collections/BitArray.h
+++ b/Source/Engine/Core/Collections/BitArray.h
@@ -46,7 +46,7 @@ public:
/// Initializes a new instance of the class.
///
/// The initial capacity.
- BitArray(const int32 capacity)
+ explicit BitArray(const int32 capacity)
: _count(0)
, _capacity(capacity)
{
diff --git a/Source/Engine/Core/Collections/Dictionary.h b/Source/Engine/Core/Collections/Dictionary.h
index 468025ffe..ad8793d36 100644
--- a/Source/Engine/Core/Collections/Dictionary.h
+++ b/Source/Engine/Core/Collections/Dictionary.h
@@ -149,7 +149,7 @@ public:
/// Initializes a new instance of the class.
///
/// The initial capacity.
- Dictionary(const int32 capacity)
+ explicit Dictionary(const int32 capacity)
{
SetCapacity(capacity);
}
diff --git a/Source/Engine/Core/Collections/HashSet.h b/Source/Engine/Core/Collections/HashSet.h
index 0be793d96..1c31eaef4 100644
--- a/Source/Engine/Core/Collections/HashSet.h
+++ b/Source/Engine/Core/Collections/HashSet.h
@@ -130,7 +130,7 @@ public:
/// Initializes a new instance of the class.
///
/// The initial capacity.
- HashSet(const int32 capacity)
+ explicit HashSet(const int32 capacity)
{
SetCapacity(capacity);
}
diff --git a/Source/Engine/Renderer/RenderListBuffer.h b/Source/Engine/Renderer/RenderListBuffer.h
index d12c430f1..50f6ed519 100644
--- a/Source/Engine/Renderer/RenderListBuffer.h
+++ b/Source/Engine/Renderer/RenderListBuffer.h
@@ -42,7 +42,7 @@ public:
/// Initializes a new instance of the class.
///
/// The initial capacity.
- RenderListBuffer(int32 capacity)
+ explicit RenderListBuffer(int32 capacity)
: _count(0)
, _capacity(capacity)
{