On Thu, Jul 27, 2006 at 06:58:32AM +1000, Erik de Castro Lopo wrote:
> Yes, that was my idea. So if the sndfile.hh has:
>
> class Sndile
> {
> int method (/* params */) ;
> }
>
> int method (/* params */)
> {
> /* whatever */
> }
>
> do I need to add an inline keyword anywhere and if so where?
You need either
class Sndfile
{
int method (/* params */) ;
}; // note the ;
inline int Sndfile::method (/* params */)
{
/* whatever */
}
or
class Sndfile
{
int method (/* params */) { /* whatever */ }
};
I use the second form often if the function body is trivial
e.g. just one statement, as for a getter / setter.
-- FA Lascia la spina, cogli la rosa.Received on Thu Jul 27 04:15:01 2006
This archive was generated by hypermail 2.1.8 : Thu Jul 27 2006 - 04:15:01 EEST