有没有任何编译器IGNORE C ++标准关于默认内联函数? [英] Are there any compilers that IGNORE C++ standard about default inline functions?
问题描述
C ++ ISO标准说:
C++ ISO standard says, that:
"A function defined within a class definition is an inline function."
是否有任何编译器忽略此规则?
错误与inlineD内联 - 我的问题是如果有一个编译器,不会在那里的内联建议它应该)
Are there any compilers that IGNORE this rule?
(please, do not mistake inline with inlineD - my question is if there is a compiler, that wont put there that inline suggestion that it should)
推荐答案
你似乎误解了内联是什么意思。这并不意味着函数将自动内联;根据7.1.2-2,它表示优先使用行内替换。
You seem to be misunderstanding what "inline" means. It doesn't mean functions will automatically be inlined; according to 7.1.2-2 it indicates that inline substitution is to be preferred.
因此,你不能知道函数是否从代码中标记为内联,因为编译器可以自由决定一种或另一种方式。这只是一个编译器提示。
Therefore, you can't tell whether a function is labeled inline or not from the code, since the compiler is free to decide one way or another. It's just a compiler hint.
这篇关于有没有任何编译器IGNORE C ++标准关于默认内联函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!