I read that inline is a hint at best, and a compiler may or may not inline a member function that has been declared inline, and it may also inline functions not delcared as inline at compile or link time.
If this is true, is there any difference between these two:
in "myClass.h":
class cls {
public:
result_t fc(typeA a, typeB b);
result_t fc(typeC c, typeB b);
...
}
inline result_t cls::fc(typeC c, typeB b) {
return fc(c.getA(), b);
}
and
class cls {
public:
result_t cls::fc(typeA a, typeB b);
result_t cls::fc(typeC a, typeB b) { return fc(c.getA(), b); } // note: not 'inline'
}
Edit: Thanks to @EmileVrijdags for the excellent link, which clearifies (for me) why the definition inside the declaration MUST be inline by default: it if wasn't there would be multiple definitions (namely on each and every place where the header file is included)