I programmed in C/C++ for years, but haven't in some time, and am unfamiliar with some of the C++ code in the snippet below.
Specifically I am confused by the inner {
}
. What is going on here. It looks like a get
method of bufferTransfer
is being called, but instead of that being followed by a semi-colon, it is followed by a bracketed segment of code. Can someone kindly tell me what this construct is called, so I can read about it elsewhere?
void process (ProcessContextReplacing<float> context)
{
context.isBypassed = bypass;
// Load a new IR if there's one available. Note that this doesn't lock or allocate!
bufferTransfer.get ([this] (BufferWithSampleRate& buf)
{
convolution.loadImpulseResponse (std::move (buf.buffer),
buf.sampleRate,
Convolution::Stereo::yes,
Convolution::Trim::yes,
Convolution::Normalise::yes);
});
convolution.process (context);
}