Skip to content

Commit

Permalink
Update includes and Fix mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mozz3d committed Feb 5, 2025
1 parent f3d1094 commit 21fb745
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 14 deletions.
10 changes: 8 additions & 2 deletions include/RED4ext/Containers/DynArray.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <algorithm>
#include <cassert>
#include <cstdint>
#include <functional>
#include <type_traits>
Expand Down Expand Up @@ -135,9 +136,14 @@ struct DynArray
return Data()[static_cast<SizeType>(aPos)];
}

[[nodiscard]] constexpr Iterator Find(ConstReference aValue) const noexcept
[[nodiscard]] constexpr Iterator Find(ConstReference aValue) noexcept
{
return std::find(cbegin(), cend(), aValue);
return Iterator(std::find(begin(), end(), aValue));
}

[[nodiscard]] constexpr ConstIterator Find(ConstReference aValue) const noexcept
{
return ConstIterator(std::find(cbegin(), cend(), aValue));
}

[[nodiscard]] bool Contains(ConstReference aValue) const
Expand Down
8 changes: 4 additions & 4 deletions include/RED4ext/Containers/Span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct Span
return IsEmpty();
}

constexpr Reference operator[](SizeType aPos) const
constexpr Reference operator[](SizeType aPos)
{
assert(aPos < Size());
return Data()[aPos];
Expand All @@ -69,7 +69,7 @@ struct Span
}

#pragma region Iterator
[[nodiscard]] constexpr Iterator begin() const noexcept
[[nodiscard]] constexpr Iterator begin() noexcept
{
return beginPtr;
}
Expand All @@ -84,7 +84,7 @@ struct Span
return begin();
}

[[nodiscard]] constexpr Iterator end() const noexcept
[[nodiscard]] constexpr Iterator end() noexcept
{
return endPtr;
}
Expand All @@ -105,7 +105,7 @@ struct Span
return !Data();
}

[[nodiscard]] constexpr Pointer Data() const noexcept
[[nodiscard]] constexpr Pointer Data() noexcept
{
return beginPtr;
}
Expand Down
2 changes: 1 addition & 1 deletion include/RED4ext/GpuApi/CommandListContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <RED4ext/CString.hpp>
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>
#include <RED4ext/Memory/UniquePtr.hpp>
#include <RED4ext/StringView.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/RED4ext/LaunchParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <RED4ext/CString.hpp>
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>
#include <RED4ext/HashMap.hpp>

namespace RED4ext
Expand Down
2 changes: 1 addition & 1 deletion include/RED4ext/ResourceDepot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <RED4ext/CString.hpp>
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>
#include <RED4ext/ResourcePath.hpp>

namespace RED4ext
Expand Down
2 changes: 1 addition & 1 deletion include/RED4ext/Scripting/Natives/CMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <RED4ext/CName.hpp>
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>
#include <RED4ext/Handle.hpp>
#include <RED4ext/NativeTypes.hpp>
#include <RED4ext/RenderResource.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/RED4ext/Scripting/Natives/inkWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <RED4ext/CName.hpp>
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>
#include <RED4ext/Handle.hpp>
#include <RED4ext/Scripting/IScriptable.hpp>
#include <RED4ext/Scripting/Natives/Generated/HDRColor.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/RED4ext/Scripting/Natives/redTagList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <RED4ext/CName.hpp>
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>

namespace RED4ext
{
Expand Down
2 changes: 1 addition & 1 deletion include/RED4ext/Scripting/ScriptReport.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <RED4ext/CString.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>
#include <cstdarg>

namespace RED4ext
Expand Down
2 changes: 1 addition & 1 deletion src/Scripting/Natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#endif

#include <RED4ext/CName.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Containers/DynArray.hpp>
#include <RED4ext/GameEngine.hpp>
#include <RED4ext/Handle.hpp>
#include <RED4ext/ISerializable.hpp>
Expand Down

0 comments on commit 21fb745

Please sign in to comment.