[linux-audio-dev] light C++ set for WAV

Fons Adriaensen fons.adriaensen at skynet.be
Wed Jul 26 21:26:49 UTC 2006


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.




More information about the Linux-audio-dev mailing list