I just tried to instantiate a dsp::DelayLine<dsp::SIMDRegister<float>>
and it failed with a compile error, telling that the reinterpret_cast
in dsp::AudioBlock::getDataPointer
would cast away the const qualifier. Looking at the implantation I found that NumericType
is deduced by SampleTypeHelpers::ElementType
. In case of a SIMDRegister
the template specialisation is picked and it will always define Type
to a non-const type, no matter if the register is const or not. Adding another explicit specialisation for the const case fixed it:
namespace SampleTypeHelpers // Internal classes needed for handling sample type classes
{
template <typename T, bool = std::is_floating_point<T>::value>
struct ElementType
{
using Type = T;
};
template <typename T>
struct ElementType<const T, false>
{
using Type = const typename T::value_type;
};
template <typename T>
struct ElementType<T, false>
{
using Type = typename T::value_type;
};
}