Skip to content

Commit

Permalink
perf: More general fixed array deduction
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Mar 16, 2024
1 parent 3a6bc13 commit f3d609b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/common/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ constexpr bool is_map<T, std::void_t<typename T::key_type, typename T::mapped_ty

template <typename T, typename = void>
constexpr bool is_fixed_array = false;
template <typename T, size_t Size>
constexpr bool is_fixed_array<std::array<T, Size>> = true;
template <template <typename, size_t> typename arr_t, typename value_t, size_t size>
constexpr bool is_fixed_array<arr_t<value_t, size>> = true;

template <typename T, typename = void>
constexpr size_t fixed_array_size = 0;
template <typename T, size_t Size>
constexpr size_t fixed_array_size<std::array<T, Size>> = Size;
template <template <typename, size_t> typename arr_t, typename value_t, size_t size>
constexpr size_t fixed_array_size<arr_t<value_t, size>> = size;

template <typename T, typename = void>
constexpr bool is_collection = false;
Expand Down

0 comments on commit f3d609b

Please sign in to comment.