I'm following the example at the following link:
I get an error on the following line:
[&n](cpp_dec_float_50& y)
g++ -I ../boost_1_71_0 fft.cpp -o fft
fft.cpp:52:3: error: expected expression
[&n](cpp_dec_float_50& y)
^
1 error generated.
The full block is:
// Generate the sine values.
std::for_each
(
sin_values.begin (),
sin_values.end (),
[&n](cpp_dec_float_50& y)
{
y = sin( pi<cpp_dec_float_50>() / pow(cpp_dec_float_50 (2), n));
++n;
}
);
What is "[&n](cpp_dec_float_50& y)" actually doing? And why is it erroring?