Collections implicit cast constructor fix

This one prohibits annoying casts. It is also important for future context injection and follows STL practice.
This commit is contained in:
Mateusz Karbowiak
2024-10-30 22:29:26 +01:00
parent f77f551b72
commit 5439efc559
5 changed files with 5 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ public:
/// Initializes a new instance of the <see cref="Array"/> class.
/// </summary>
/// <param name="capacity">The initial capacity.</param>
Array(int32 capacity)
explicit Array(int32 capacity)
: _count(0)
, _capacity(capacity)
{

View File

@@ -46,7 +46,7 @@ public:
/// Initializes a new instance of the <see cref="BitArray"/> class.
/// </summary>
/// <param name="capacity">The initial capacity.</param>
BitArray(const int32 capacity)
explicit BitArray(const int32 capacity)
: _count(0)
, _capacity(capacity)
{

View File

@@ -149,7 +149,7 @@ public:
/// Initializes a new instance of the <see cref="Dictionary"/> class.
/// </summary>
/// <param name="capacity">The initial capacity.</param>
Dictionary(const int32 capacity)
explicit Dictionary(const int32 capacity)
{
SetCapacity(capacity);
}

View File

@@ -130,7 +130,7 @@ public:
/// Initializes a new instance of the <see cref="HashSet"/> class.
/// </summary>
/// <param name="capacity">The initial capacity.</param>
HashSet(const int32 capacity)
explicit HashSet(const int32 capacity)
{
SetCapacity(capacity);
}

View File

@@ -42,7 +42,7 @@ public:
/// Initializes a new instance of the <see cref="RenderListBuffer"/> class.
/// </summary>
/// <param name="capacity">The initial capacity.</param>
RenderListBuffer(int32 capacity)
explicit RenderListBuffer(int32 capacity)
: _count(0)
, _capacity(capacity)
{