3 ms·
Does D have something like Rust's #[derive(Debug)] or #[derive(Hash)]?
by edflsafoiewq 7y ago
Does D have something like Rust's #[derive(Debug)] or #[derive(Hash)]?
- Neku42 7y agoStandard library doesn’t provide similar functionality but it’s trivial to implement a mixin template that would implement print or hash function for any type That being said standard formatting function can automatically print most types including user types. This eliminates necessity for automatic formatting implementation in majority of situations
- mhh__ 7y agoNot really required because serialization is trivial in D. D's compilation isn't "stateful" like that in the sense that (user-defined) attributes both cannot influence the thing they are attached to or do anything without being read by something else.