• voodooattack@lemmy.worldOP
    link
    fedilink
    arrow-up
    1
    ·
    3 hours ago

    The problem is that lambdas with a capture aren’t strongly typed, so you have to use auto. And if you pass such a lambda to a function you’ll have to use auto as well.

    If you write a lambda with a capture that calls itself recursively you’ll have to pass it to itself as an auto argument as part of the call signature.

    I think this article explains it better: https://artificial-mind.net/blog/2020/09/12/recursive-lambdas