Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: Understanding the classical model for linking, groundwork: The algorithm

$
0
0

One more comment on "inline" for the moment.

C++03 standard, 7.1.2 [Function specifiers], footnote #79: "The 'inline' keyword has no effect on the linkage of a function". Para 4: "If a function with external linkage is declared inline in one translation unit, it shall be declared inline in all translation units in which it appears; no diagnostic is required. An inline function with external linkage shall have the same address in all translation units. A static local variable in an extern inline function always refers to the same object. A string literal in an extern inline function is the same object in different translation units."

So I stand by my earlier statement that C++03 'inline' will leave functions with external linkage, and because of the other requirements of that paragraph you need something like 'selectany'.

What MSVC does is a somewhat different matter.


Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>