3 ms·
If you read the end of that interfaces article, you'll see a low-boilerplate way to get interfaces using tagged enums. There's no pointer casting etc. involved.
by cgh 2y ago
If you read the end of that interfaces article, you'll see a low-boilerplate way to get interfaces using tagged enums. There's no pointer casting etc. involved.
- remexre 2y agoThat relies on whoever's defining the Writer knowing every implementation of Writer in existence though, right? Same reason why Rust has both enums and trait objects; it's the expression problem.