Closed zachbellay closed 3 years ago
AFAIK, you cannot use auto for array declarations. You could use something like this:
using filter_t = decltype(butter<10>(f_n));
filter_t filters[] = {
butter<10>(f_n), butter<10>(f_n), butter<10>(f_n), butter<10>(f_n),
butter<10>(f_n), butter<10>(f_n), butter<10>(f_n),
};
Awesome! Thank you for the quick reply, this solved the issue. Thank you so much!
Hello,
Thank you for this wonderful library, I was hoping to use an array of butterworth filters, but my C++ skills aren't up to par to debug this issue. What I want is very simple:
auto filters[7]={butter<10>(f_n),butter<10>(f_n),butter<10>(f_n),butter<10>(f_n),butter<10>(f_n),butter<10>(f_n),butter<10>(f_n)};
and here is the resulting compilation error:
unable to deduce 'std::initializer_list<_Tp> [7]' from '{butter<10u, float, BiQuadFilterDF1<float> >(1.0e+0, 1), butter<10u, float, BiQuadFilterDF1<float> >(1.0e+0, 1), butter<10u, float, BiQuadFilterDF1<float> >(1.0e+0, 1), butter<10u, float, BiQuadFilterDF1<float> >(1.0e+0, 1), butter<10u, float, BiQuadFilterDF1<float> >(1.0e+0, 1), butter<10u, float, BiQuadFilterDF1<float> >(1.0e+0, 1), butter<10u, float, BiQuadFilterDF1<float> >(1.0e+0, 1)}'
Any help would be appreciated, thanks.