replaced with STL relization

This commit is contained in:
2025-04-11 23:10:02 +03:00
parent b58956efe3
commit 3631c5d698

View File

@@ -9,6 +9,7 @@
#include <stdexcept> #include <stdexcept>
#include <utility> #include <utility>
#include "omath/vector3.hpp" #include "omath/vector3.hpp"
#include <numeric>
#ifdef near #ifdef near
@@ -141,12 +142,7 @@ namespace omath
[[nodiscard]] [[nodiscard]]
constexpr Type Sum() const noexcept constexpr Type Sum() const noexcept
{ {
Type sum = 0; return std::accumulate(m_data.begin(), m_data.end(), Type(0));
for (size_t i = 0; i < Rows; ++i)
for (size_t j = 0; j < Columns; ++j)
sum += At(i, j);
return sum;
} }
constexpr void Clear() noexcept constexpr void Clear() noexcept