"Walter Bright"  wrote in message news:maq8ao$2idu$1...@digitalmars.com...

Yup. I understand the concern that a compiler would opt out of inlining those if it legally could, but I just cannot see that happening in reality. Modern compilers have been inlining for 25 years now, and they're not likely to just stop doing it.

No, the problem is that the code might accidentally contain a construct that is not inlineable. The user will expect it to be inlined, but the compiler will silently fail.

eg

void myWrapperFunc()
{
   callSomeFunc(999, 123, "something");
}

This function will not be inlined if callSomeFunc has a default arugment that calls alloca, for example. If a hidden failure becomes a compiler error, the user can trivially correct the problem.

Reply via email to