the example code for dsp::WaveShaper
shows initialization like this:
dsp::WaveShaper<float> ws({ std::tanh });
and the longer form works too:
dsp::WaveShaper<float> ws({[](float sample){ return std::tanh(sample); } })
but if i try to capture anything xcode blows up so this:
dsp::WaveShaper<float> ws({[foo](float sample){ return std::tanh(sample + foo); } })
gives me:
error: no matching constructor for initialization of 'juce::dsp::WaveShaper<float>' ../../JuceLibraryCode/modules/juce_dsp/processors/juce_WaveShaper.h:36:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to 'const juce::dsp::WaveShaper<float, float (*)(float)>' struct WaveShaper ^ ../../JuceLibraryCode/modules/juce_dsp/processors/juce_WaveShaper.h:36:8: note: candidate constructor (the implicit move constructor) not viable: cannot convert initializer list argument to 'juce::dsp::WaveShaper<float, float (*)(float)>' ../../JuceLibraryCode/modules/juce_dsp/processors/juce_WaveShaper.h:36:8: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided 1 error generated.
what am i doing wrong? is there a way to do this?