• asdfasdfasdf@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    What I’m curious about - this function was already const, so for stuff like this, is think there’d basically be a 100% chance the compiler would optimize this too so it implicitly.

    AFAIK new feature is just for times when it isn’t an optimization, but more your own domain invariants. E.g. assertions.

    But I couldn’t be wrong. I wonder if this can be used for actual optimizations in some places that the compiler couldn’t figure out by itself.