Remix.run Logo
menaerus 16 hours ago

No, they are not.

aw1621107 15 hours ago | parent | next [-]

They are both; there are things that Rust's macros can do metaprogramming-wise that C++ templates cannot do and vice-versa.

Rust's macros work on a syntactic level, so they are more powerful in that they can work with "normally" invalid code and perform token-to-token transformations (and in the case of proc macros effectively function as compiler extensions/plugins) and less powerful in that they don't have access to semantic information.

aldanor 12 hours ago | parent | prev [-]

Incorrect.