T
toton
Hi,
As inline is not mandetory, it depends on compiler to inline certain
function (or using switch like fior GCC), my question is there any
scope for inlining when it is not declared as inline function?
i.e compiler may choose not to inline certain inline function, but is
it free to choose a non inline function to inline it?
I have some simple one line get function, and index operators which I
want to get inlined. But due to some problem (like I have some circular
dependency, thus use forward declaration, and hence not possible to
have some get function implemented in header).
Secondly, If i build a library with the getter function in the cpp
file, rather than header, (and so it is not inlined) , does it mean
that the scope for optimization is lost for inlining? If it is even
have a function call, how costly will it be (comparing to inlined
version) , given the fact it is a getter and thus do not have any
parameter list.
Those get functions return certain kind of container , which in turns
a class use to return a begin & end iterator for the container. ( i.e a
view class construct a pair of iterator with the help of original
container whose reference it holds, for certain range, and return).
As inline is not mandetory, it depends on compiler to inline certain
function (or using switch like fior GCC), my question is there any
scope for inlining when it is not declared as inline function?
i.e compiler may choose not to inline certain inline function, but is
it free to choose a non inline function to inline it?
I have some simple one line get function, and index operators which I
want to get inlined. But due to some problem (like I have some circular
dependency, thus use forward declaration, and hence not possible to
have some get function implemented in header).
Secondly, If i build a library with the getter function in the cpp
file, rather than header, (and so it is not inlined) , does it mean
that the scope for optimization is lost for inlining? If it is even
have a function call, how costly will it be (comparing to inlined
version) , given the fact it is a getter and thus do not have any
parameter list.
Those get functions return certain kind of container , which in turns
a class use to return a begin & end iterator for the container. ( i.e a
view class construct a pair of iterator with the help of original
container whose reference it holds, for certain range, and return).