I've used the tilde operator in Unity + C# quite a bit when mutating bitmasks that store state. For example, my player movement code manages its state within a bitmask. To remove a certain state, I do something like this to ensure the player exits a given state:
Your feedbacks are valuable! Thanks!
If you do not use Medium, you can read the blog on the repository: https://github.com/Dentrax/go-tilde-operator/
Find the issue proposal: https://github.com/golang/go/issues/46847 Find the implementation PR: https://github.com/golang/go/pull/46848