I have a static
method my_method_1()
in my_class
, and I am trying to use it in a lambda:
static void my_method_1(el);
void my_class::my_method_2()
{
std::for_each(my_list_.begin(), my_list_.end(),
[](auto& element)
{
my_method_1(element);
});
}
gcc6 gives me an error:
'this' was not captured for this lambda function
In gcc4, it compiles.