#golang trick: test whether two structs have the same size at compile time: https://play.golang.org/p/cnaAt-hsTTG
-
-
Compile-time assertion that a constant is a power of 2: var _ [0]struct{} = [c & (c - 1)]struct{}{}
Show this thread -
Apparently such checks have been used in the Linux kernel for a long time now: https://elixir.bootlin.com/linux/v4.2/source/include/linux/bug.h#L71 … Makes me think that any new language should have first-class support for compile-time asserts.
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.