I read about inline functions in C ++, and basically I realized that the compiler will copy the embeddable function code, which is inline. If the built-in function contains a return statement and the function is used in some other function, will this lead to the termination and return of the caller's function?
As an example, consider
inline int foo(void) { return 1; } int bar(void) { //Some statements foo() //Some more statements return 2; }
Will it return foo()c bar() before the bar reaches the line return 2;, because the code is copied to the compiler? Otherwise, how is the return statement handled by inline functions? I understand that this will not disrupt the code flow now, but how is the return statement handled if the code is copied or embedded?
foo()
bar(
return 2;
- , - ( , , ). , , .
. ++, ( , elision). .
, , -. , return , , , , - , , ( { ).
return
{
foo() 1. , , 1 -, , . - , , 1 , - , , "" 1. foo() , , no-op.
1