   inline in VC++ ?
  Hi guys,When I inline a function in Visual C++ (6.0) do I add the inline keyword to both the prototype and the definition or just the prototype ? Like this:// like this ?inline int MyFunction(int x);inline int MyFunction(int x){return x+666;}// or this ?inline int MyFunction(int x);int MyFunction(int x){return x+666;}// or maybe even this ?int MyFunction(int x);inline int MyFunction(int x){return x+666;}Thanks. 
  In order for VC6.0 to actually inline it, the function needs to be defined in the header at the same time that it''s declared. They shouldn''t be seperated, so, it''s really a pointless question, hmm?I''m not certain about the details though. Is this a language, or VC6.0 thing? Has it changed with 7.0 and above? ;  you only need the inline before the prototype or place the function body inside the class which marks it for automatic inlining without the need to explicity declare it inline   [edited by - Spudder on February 11, 2004 6:08:16 PM];  Since inline functions must be defined in every translation unit that uses them, you don't usually have a separate declaration (prototype), just the definition itself. The C++ standard seems to imply that having inline either in the declaration or the definition is sufficient (C++ standard 7.1.1-7 [dcl.stc] and 7.1.2 [dcl.fct.spec]). The full definition will still have to come before   any use of the function (unlike non-inline functions where function prototypes are actually useful).   “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”    — Brian W. Kernighan (C programming language co-inventor) [edited by - Fruny on February 11, 2004 6:16:20 PM]