TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JAVIER KOHEN
from: CLIFF RHODES
date: 1997-08-21 10:33:00
subject: inline const;

--> Javier Kohen wrote to Cliff Rhodes <--
JK>Why would BC++ 4.51 sometimes compile inline int
JK>SomeClass:someFunc(void) const; fine, but the linker won't
JK>find the "symbol".
 
CR> Is the definition of someFunc() visible to all modules that
CR> call it? IE, is it in a header file? Not just a declaration, a
CR> definition.
 
JK>enum Boolean {
JK>        False, True
JK>};
JK> 
JK>class Mouse {
JK> 
JK>[..]
JK> 
JK>public:
JK> 
JK>[..]
JK> 
JK>        /* This should be "inline Boolean installed() const;". */
JK>        Boolean installed() const;
It won't be inline unless you define it here inside the class OR you 
define it outside the class but still inside the header.
JK>[..]
JK>};
// Define the inline function outside the class
inline Boolean Mouse::installed(void) const { /* ... */ }
PS: You should also use the C++ bool type with true and false!
Cliff Rhodes
cliff.rhodes@juge.com
crhodes@flash.net
X CMPQwk 1.42 1692 X"Cruel is the strife of brothers." - Aristotle
--- Maximus/2 3.01
---------------
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)

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™.