Browse Source

algorithm: avoid C-arrays

Michele Caini 1 year ago
parent
commit
1e90bee7ad
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/entt/core/algorithm.hpp

+ 3 - 2
src/entt/core/algorithm.hpp

@@ -2,6 +2,7 @@
 #define ENTT_CORE_ALGORITHM_HPP
 #define ENTT_CORE_ALGORITHM_HPP
 
 
 #include <algorithm>
 #include <algorithm>
+#include <array>
 #include <functional>
 #include <functional>
 #include <iterator>
 #include <iterator>
 #include <utility>
 #include <utility>
@@ -104,8 +105,8 @@ struct radix_sort {
                 constexpr auto mask = (1 << Bit) - 1;
                 constexpr auto mask = (1 << Bit) - 1;
                 constexpr auto buckets = 1 << Bit;
                 constexpr auto buckets = 1 << Bit;
 
 
-                std::size_t index[buckets]{};
-                std::size_t count[buckets]{};
+                std::array<std::size_t, buckets> index{};
+                std::array<std::size_t, buckets> count{};
 
 
                 for(auto it = from; it != to; ++it) {
                 for(auto it = from; it != to; ++it) {
                     ++count[(getter(*it) >> start) & mask];
                     ++count[(getter(*it) >> start) & mask];