65template <
size_t Start,
size_t End,
size_t Inc,
class F>
constexpr void constexpr_for(F&& f)
68 if constexpr (Start < End) {
92 f.template operator()<Start>();
96 constexpr_for<Start + Inc, End, Inc>(f);
115 if constexpr (std::get<k>(container) == key) {
140template <
typename T, std::size_t... Is>
141constexpr std::array<T,
sizeof...(Is)>
create_array(T value, std::index_sequence<Is...> )
144 std::array<T,
sizeof...(Is)> result = { { (
static_cast<void>(Is), value)... } };
160 return create_array(T(0), std::make_index_sequence<N>());
constexpr_utils defines some helper methods that perform some stl-equivalent operations but in a cons...
Definition: constexpr_utils.hpp:16
constexpr bool constexpr_find()
returns true/false depending on whether key is in container
Definition: constexpr_utils.hpp:110
constexpr std::array< T, sizeof...(Is)> create_array(T value, std::index_sequence< Is... >)
Create a constexpr array object whose elements contain a default value.
Definition: constexpr_utils.hpp:141
constexpr void constexpr_for(F &&f)
Implements a loop using a compile-time iterator. Requires c++20. Implementation (and description) fro...
Definition: constexpr_utils.hpp:65
constexpr std::array< T, N > create_empty_array()
Create a constexpr array object whose values all are 0.
Definition: constexpr_utils.hpp:158