pplppp
2004-06-24 11:40:21 UTC
1. I read from "Using GNU CC" that a non-static inline function is
always ompiled on its own in the usual fashion, does CC for SCO
Unixware treats non-static inline functions the same way?
2. the man page for CC says the compiler would 'inline' some functions
even if the programmer didn't explicitly declared the function as
inline, so are one-line non-static functions 'inline'd ?
3. I have the declaration of class Foo in a header file, and a public
member function which I made it a static inline function. But when I
try to put in the definition for the function in the C file, the
compiler complains about the storage class is not defined or
something.
Foo.h
class Foo
{
public:
static inline void boo();
}
Foo.C
static inline void Foo::boo()
{
printf("Foo::boo\n");
}
If I remove the static modifier in the C file the compiler doesn't
complain. So I would like to know why the compiler complained and when
it doesn't complain after I removed the static modifier. I'm using CC
for SCO Unixware
thanks in advance
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
always ompiled on its own in the usual fashion, does CC for SCO
Unixware treats non-static inline functions the same way?
2. the man page for CC says the compiler would 'inline' some functions
even if the programmer didn't explicitly declared the function as
inline, so are one-line non-static functions 'inline'd ?
3. I have the declaration of class Foo in a header file, and a public
member function which I made it a static inline function. But when I
try to put in the definition for the function in the C file, the
compiler complains about the storage class is not defined or
something.
Foo.h
class Foo
{
public:
static inline void boo();
}
Foo.C
static inline void Foo::boo()
{
printf("Foo::boo\n");
}
If I remove the static modifier in the C file the compiler doesn't
complain. So I would like to know why the compiler complained and when
it doesn't complain after I removed the static modifier. I'm using CC
for SCO Unixware
thanks in advance
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]