Is there a way to construct a template class that functions as both a compile and runtime array (much like the C89 constant size array and the same C99 variable length array) which allows for logical semantics (one template parameter for the variable length array, two for the fixed length, much like std::array
).
To top it off, I'd like to prevent code duplication between the two cases, as most functions are identical between the two cases. Is there a way to use constexpr
or enable_if
to achieve this?