When one function calls another, and inlining is desired, is the order of the definitions of the two functions important? Assume that the two definitions occur in the same translation unit.
I am primarily interested in what the C++ standard says about it, if anything. However, if you have important information about the inlining behavior in specific compilers, I would be interested in that too. Please assume that no link-time optimization occurs (is disabled).
Specifically, are the following two versions equally likely to achieve inlining according to the C++ standard?
Version one:
inline void foo() { ... }
void bar() { ... foo(); ... }
Version two:
inline void foo();
void bar() { ... foo(); ... }
void foo() { ... }
EDIT: Please note that this question is not about the effectiveness of the inline
keyword with respect to achieving inlining in general. I specifically ask about whether the standard says anything about the order of function definitions in relation to achieving inlining.