In modern C++, what is the main language-level guarantee of declaring a function inline?
Correct answer A. It may be defined in several translation units without violating the one-definition rule
inline is now chiefly a linkage rule: an inline function may be defined identically in multiple translation units, typically by placing it in a header, without causing duplicate-definition linker errors. Whether calls are actually expanded in place is entirely the optimiser's decision, and compilers often inline non-inline functions or ignore the hint. Inline functions can still have their address taken.
Answer checked How we write and check questions
Discussion