TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CLIFF RHODES
from: JONATHAN DE BOYNE POLLARD
date: 1997-10-21 00:37:00
subject: inline const;

 CR> If you define an inline function outside of a header file,
 CR> it  must be local to one module. 
An inline function that is defined in one translation unit may or may not 
have external linkage.  An inline function that is defined in *more* than one 
translation unit *should* (not "must") have internal linkage, because if it 
has external linkage, the One Definition Rule applies, which means that 
unless you are careful your program can be ill-formed but no diagnostic need 
necessarily occur.  This is, to put it mildly, a rather large headache, and 
one reason that `extern inline' functions are best off in headers.
Incidentally, the default for inline functions, in the latest draft of the 
Standard, is to have external linkage, just like all other functions.  So 
start labelling your inline functions explicitly `static' now, so that you 
get into the habit.
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.