What is the difference between macros and functions in Rust?

后端 未结 3 1431
一个人的身影
一个人的身影 2020-12-18 20:00

Quoted from the Rust blog:

One last thing to mention: Rust’s macros are significantly different from C macros, if you’ve used those

3条回答
  •  春和景丽
    2020-12-18 20:48

    In macro, you can take variable number of parameters.

    In function you have to define number and type of parameters.

提交回复
热议问题