#How does Lambda work?

12 messages · Page 1 of 1 (latest)

fathom skiff
#

so i was given this code and it has an error in it but in order to fix this i need to understand how exactly lambda works

untold trenchBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

frank sandal
#

wdym by that?

fathom skiff
#
velocity += std::reduce(std::execution::par, begin, end, [&](sf::Vertex const& v1, sf::Vertex const& v2)
    {
        return calcVelocityChangeFor(v1) + calcVelocityChangeFor(v2);
    });

    return velocity;
#

this is the full code

#

and this is the entire function

halcyon viper
#

I thought reduce was called std::accumulate

frank sandal
#

there's both

#

accumulate guarantees a certain order of evaluation while reduce doesn't

halcyon viper
#

ah

untold trenchBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.