That's one of the cases where you can't "mechanically" translate C++ to Rust. To obtain the same result, a good choice would be a proc macro.
Which is a pain to implement, but will also give you more flexibility.
That's one of the cases where you can't "mechanically" translate C++ to Rust. To obtain the same result, a good choice would be a proc macro.
Which is a pain to implement, but will also give you more flexibility.