I have some code with lambda expression and my problem is that I would like to return something only if "if" isn't nullptr. Other way I don't want to return anything. Is there a return that can be used in this code? Or maybe another way to not getting warning?
auto iter = std::stable_partition(object1->vector_.begin(), object1->vector_.end(), [](Class* x)
{
if (x->object2_ != nullptr)
{
return !x->object2->parameter_;
}
});
It's working good, but this warning is annoying and I know that I should do something with this.