Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/frg/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ constexpr auto array_concat(const Ts &...arrays) {

namespace std {

template <class T, size_t N>
constexpr size_t size(const T (&array)[N]) noexcept
{
Comment thread
davidtranhq marked this conversation as resolved.
Outdated
return N;
Comment thread
davidtranhq marked this conversation as resolved.
Outdated
}

template <class T, ptrdiff_t N>
constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept
{
return N;
}

template<size_t I, class T, size_t N>
constexpr T &get(frg::array<T, N> &a) noexcept {
static_assert(I < N, "array index is not within bounds");
Expand Down