Skip to content

Commit

Permalink
style(core): use default member initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Sep 28, 2023
1 parent f24b4d8 commit 6243a97
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
19 changes: 15 additions & 4 deletions core/include/cubos/core/reflection/traits/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ namespace cubos::core::reflection
class ArrayTrait final
{
public:
/// @brief Provides mutable access to an array.
class View;

/// @brief Provides immutable access to an array.
class ConstView;

/// @brief Function pointer to get the length of an array instance.
/// @param instance Pointer to the instance.
using Length = std::size_t (*)(const void* instance);
Expand Down Expand Up @@ -74,6 +80,11 @@ namespace cubos::core::reflection
/// @return Element type.
const Type& elementType() const;

/// @brief Returns a view of the given array instance.
/// @param instance Array instance.
/// @return Array view.
View view(void* instance) const;

/// @brief Returns the length of the given array.
/// @param instance Pointer to the array instance.
/// @return Array length.
Expand Down Expand Up @@ -134,9 +145,9 @@ namespace cubos::core::reflection
const Type& mElementType;
Length mLength;
AddressOf mAddressOf;
InsertDefault mInsertDefault;
InsertCopy mInsertCopy;
InsertMove mInsertMove;
Erase mErase;
InsertDefault mInsertDefault{nullptr};
InsertCopy mInsertCopy{nullptr};
InsertMove mInsertMove{nullptr};
Erase mErase{nullptr};
};
} // namespace cubos::core::reflection
4 changes: 0 additions & 4 deletions core/src/cubos/core/reflection/traits/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ ArrayTrait::ArrayTrait(const Type& elementType, Length length, AddressOf address
: mElementType(elementType)
, mLength(length)
, mAddressOf(addressOf)
, mInsertDefault(nullptr)
, mInsertCopy(nullptr)
, mInsertMove(nullptr)
, mErase(nullptr)
{
}

Expand Down

0 comments on commit 6243a97

Please sign in to comment.