I just tried it out here, supplying these two simple template specialisation makes a juce::dsp::ProcessorChain
is compatible with C++ 17 structured binding
namespace std
{
template <typename... Processors>
struct tuple_size<::juce::dsp::ProcessorChain<Processors...>>
{
static constexpr size_t value = sizeof... (Processors);
};
template <size_t Index, typename... Processors>
struct tuple_element<Index, ::juce::dsp::ProcessorChain<Processors...>>
: tuple_element<Index, tuple<Processors...>>
{};
}
Now you can write something like e.g.
juce::dsp::ProcessorChain<juce::dsp::Gain<float>, juce::dsp::IIR::Filter<float>> chain;
auto& [gain, filter] = chain;
gain.setGainDecibels (-3.0f);
*filter.coefficients = someCoeffs;
which is just super beautiful and verbose from my point of view What do you think?