Move constexpr compatible Array struct to meta.hh
This commit is contained in:
parent
eec8239c78
commit
a578c51baf
11
src/enum.hh
11
src/enum.hh
|
@ -6,17 +6,6 @@
|
|||
namespace Kakoune
|
||||
{
|
||||
|
||||
template<typename T, size_t N>
|
||||
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<typename T> struct EnumDesc { T value; StringView name; };
|
||||
|
||||
}
|
||||
|
|
12
src/meta.hh
12
src/meta.hh
|
@ -9,6 +9,18 @@ inline namespace Meta
|
|||
template<typename T> struct Type {};
|
||||
|
||||
}
|
||||
|
||||
template<typename T, size_t N>
|
||||
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];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // meta_hh_INCLUDED
|
||||
|
|
Loading…
Reference in New Issue
Block a user