#ifndef meta_hh_INCLUDED #define meta_hh_INCLUDED #include namespace Kakoune { inline namespace Meta { struct AnyType{}; template struct Type : AnyType {}; } template struct Array { constexpr size_t size() const { return N; } constexpr const T& operator[](int i) const { return m_data[i]; } constexpr const T* begin() const { return m_data; } constexpr const T* end() const { return m_data+N; } T m_data[N]; }; template constexpr Array make_array(const T (&data)[N], std::index_sequence) { static_assert(sizeof...(Indices) == N, "size mismatch"); return {{data[Indices]...}}; } template constexpr Array make_array(const T (&data)[N]) { return make_array(data, std::make_index_sequence()); } } #endif // meta_hh_INCLUDED