Hello,
It's been a while since I checked in here.
Is it possible to use an array of constant values as a template parameter. I am writing preliminary benchmark code for ISO/IEC 14882:2011, so I could also use std::array or std::initializer_list.
In the mathematical template below, I use integer coefficients. The template has order 3.
If I want to write more generic code, I could use order N and an array-type template parameter. But it does not work with compilers like VS2010 and GCC 4.6.x. Can it work or *should* something like this ever work without variadic templates?Code:template<const std::size_t order, const std::uint_least16_t B0, const std::uint_least16_t B1, const std::uint_least16_t B2, const std::uint_least16_t B3> struct order3_math { // Do order-3 math. };
Thank you.Code:// Can I do anything like this? template<const std::size_t order, const std::array<std::uint_least16_t, order> coefficients> struct orderN_math { // Do order-N math. };
Sincerely, Chris.




Reply With Quote