I thought about it again, but you can of course use your own types in this very way. You can "test" if a struct has a certain (zero-sized, embedded) member. It's just cumbersome, and needs to be implemented through-out your code, so it's only suitable for very small "flagging" operations. It's not comparable to annotations in other languages.
Comments
I thought about it again, but you can of course use your own types in this very way. You can "test" if a struct has a certain (zero-sized, embedded) member. It's just cumbersome, and needs to be implemented through-out your code, so it's only suitable for very small "flagging" operations. It's not comparable to annotations in other languages.