Thanks to visit codestin.com
Credit goes to programming.dev

  • HoloPengin@lemmy.world
    Codestin Search App
    Codestin Search App
    Codestin Search App
    1
    ·
    Codestin Search App
    6 days ago

    NGL that block pattern thing is something I never really noticed but it makes a lot of sense. The messy way to do it in C++ would be with a lambda that you then just evaluate, but being about to avoid that and instead using standard scoping syntax for the same thing neat. I’m pretty sure I’ve even done this before without even thinking about it.

    And if you put all of the definitions you need right at the top it’s super easy to split out into a function if/when you need it elsewhere