creating an std::array with size calculated during run time
问题 I want to create an object of std::array<T, N> but the problem is I can only use functions that return a constexpr type or compiler will complain. The problem here is that I need to calculate the length of this array based on another array's size which could be something like this: template <typename T> struct DataLength { template <typename iter> size_t maxPossibleLength(iter begin, iter end) { size_t m_size = 0; while (begin != end) { m_size = m_size << 8 | std::numeric_limits<T>::max(); /*