C++ inline - where to specify?
I'm trying to verify that my inline specification is correct:
If have a function declared as inline both in the class header file in the .cpp file where it is defined, I get the following warning when compiling any module that calls this function:
Warning from compilation:
test.h:977: warning: inline function `long myClass::getState() const' used but never defined
Header file declaration:
inline long getState();
Function definition in C++ module:
inline long myClass::getState() {
return currentState;
}
When I remove "inline" from the header prototype I get no warning:
I assume this is correct (?) Is there any way to verify that it is actually inlined by looking at the object file using nm or something?
Thanks for any help,
Mike
|