3 ms·
They are differently powerful. Rust's macros can let you extend the syntax and do context-free code generation, where as C++ can let you to type-directed code g
by bjz_ 6y ago
They are differently powerful. Rust's macros can let you extend the syntax and do context-free code generation, where as C++ can let you to type-directed code generation. You can do the latter in Rust using trait dispatch, but it's more awkward and less expressive than what C++ has.
- pas 6y agoIt's not a panacea, but enum_dispatch seems to help a lot: https://docs.rs/enum_dispatch/0.3.5/enum_dispatch/ https://docs.rs/enum_dispatch/0.3.5/enum_dispatch/