Y
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
SkiFire13
23 days ago
You could do `bool::not` before, but this is clearer and doesn't require imports.
link
CUViper
22 days ago
`bool::not` returns the value, while `bool::toggle` is more like a `not_assign`.
link
masklinn
23 days ago
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.
link