#ifndef PLAYGROUND_H #define PLAYGROUND_H extern "C" void halt(); extern "C" void init_high(); extern "C" int main(); extern "C" void Default_Handler(); #include #include #include // TODO: replace with std::extent<>; http://en.cppreference.com/w/cpp/types/extent //template //static inline constexpr //std::size_t SizeOfArray(const T(&)[N]) { // return N; //} /* namespace { template struct identity { using type = T; }; } template static inline constexpr typename identity::type SizeOfArray(const T(&)[N]) { static_assert(std::numeric_limits::max() >= N, "N does not fit in R"); return static_cast(N); } */ template static inline constexpr R SizeOfArray(const T(&)[N]) { static_assert(std::numeric_limits::max() >= N, "N does not fit in R"); return static_cast(N); } #endif