#pragma once #include "compat/integer-types.hpp" #include #include #include #include namespace floormat::detail::map { template CORRADE_ALWAYS_INLINE constexpr auto map0(const std::array& array, const F& fun, std::index_sequence) { return std::array { fun(array[Indexes])... }; } template [[deprecated("zero-length array!")]] CORRADE_ALWAYS_INLINE constexpr auto map0(const std::array&, const F& fun, std::index_sequence<>) { return std::array()) )> , 0>{}; } } // namespace floormat::detail::map namespace floormat { template F, size_t N> constexpr auto map(const std::array& array, const F& fun) { using return_type = std::decay_t; static_assert(!std::is_same_v); static_assert(std::is_same_v>); static_assert(sizeof(return_type) > 0); using ::floormat::detail::map::map0; return map0(array, fun, std::make_index_sequence{}); } } // namespace floormat