Are there any compilers that IGNORE C++ standard about default inline functions?

前端 未结 5 737
忘了有多久
忘了有多久 2021-01-25 08:17

C++ ISO standard says, that:

\"A function defined within a class definition is an inline function.\"

Are there any compilers that IGNORE th

5条回答
  •  感动是毒
    2021-01-25 08:54

    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.

提交回复
热议问题