0
 #include <iostream>
 using namespace std;

 void f();

 int main(){
      f();
 }

 void f(){
     cout << "Hello Stackoverflow!" << endl;
 }

If I wanted to succeed in making this function inline, would I need to specify inline in the declaration or definition, or both? I know that inline functions are normally defined in headers so normally there shouldn't be a separate declaration, but I was curious about the few unique cases where there are.

AntiElephant
  • 1,227
  • 10
  • 18
  • 2
    Using inline doesn't really mean a whole lot. It's mostly a hint to the compiler, not something it's obligated to follow. – Falmarri Aug 14 '15 at 23:48
  • 3
    I think your question has already been answered [here](http://stackoverflow.com/questions/9268542/inline-in-definition-and-declaration?rq=1) and i second falmarri, see [this](http://stackoverflow.com/questions/1759300/when-should-i-write-the-keyword-inline-for-a-function-method?rq=1) – Caninonos Aug 14 '15 at 23:49

0 Answers0