macro&和有什么不一样?关于执行速度的内联函数? [英] What is the difference between macro & inline function with respect to execution speed?

查看:78
本文介绍了macro&和有什么不一样?关于执行速度的内联函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译器如何通过宏处理内联函数以减少执行时间?

How complier treats inline functions over macros to reduce execution time?

推荐答案

如果这样做会更快,则编译器也可以内联该函数,而编译器不能内联一个宏.此外,内联函数比宏要安全得多.

The compiler is also allowed to not inline the function if doing so would be faster, whereas the compiler cannot not inline a macro. In addition, inline functions are miles safer than macros.

这篇关于macro&和有什么不一样?关于执行速度的内联函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆