Hacker News new | ask | show | jobs
by brabel 23 days ago
My first thought was that this is useful when you need a lambda that does this, now you can use ::toggle
2 comments

You could do `bool::not` before, but this is clearer and doesn't require imports.
`bool::not` returns the value, while `bool::toggle` is more like a `not_assign`.
Now I just need the integer types to gain in-place inc() and dec()

I don’t know how to feel about toggle returning neither old nor new value tho.