c++ - When inline function actually replaces the code and is it possible to put a break point? -
i have questions inline functions mentioned below.
1) read function call of inline function replaced code @ compile time. if true, can 1 please let me know how work virtual functions because virtual function concept based on late binding.
2) possible put break point inside inline function?
3) if inline function replacing function call , if inline function has return statement, why caller of inline function not terminated return statement of inline function?
4) there way force gcc compiler use function inline instead of suggestion compiler?
1) simple answer: not work virtual functions of time. see are inline virtual functions non-sense? more detailed answer.
2) yes can. compilers not perform inlining debug builds.
3) of course compiler not put "ret" assembly instruction in calling code. think abut way:
// before inlining: int myfunc () { return 5; } int = myfunc(); // after inlining: int = 5;
4) see here answer: how force gcc inline function?
btw: using google have answered questions in less time ;-)
Comments
Post a Comment