T
Tony Johansson
Hello experts!
I reading a book called programming with design pattern revealed
by Tomasz Muldner and here I read something that sound strange.
Here is the whole section:
It says" Because inline functions are expanded at compile time, definitions
of these
functions, unlike other definitions cannot be separately compiled and must
be
placed in header files. This creates a problem if the compiler does not
actually inline
a function (you may end up having multiple definitions of the same function)
Therefore, you have to check that the inline functions will actually be
inlined.,
and if they cannot be inlined, you must remove the inline specification."
My question is what does it mean with this This creates a problem if the
compiler does not actually inline
a function (you may end up having multiple definitions of the same function)
Therefore, you have to check that the inline functions will actually be
inlined,
and if they cannot be inlined, you must remove the inline specification.
Many thanks
//Tony
I reading a book called programming with design pattern revealed
by Tomasz Muldner and here I read something that sound strange.
Here is the whole section:
It says" Because inline functions are expanded at compile time, definitions
of these
functions, unlike other definitions cannot be separately compiled and must
be
placed in header files. This creates a problem if the compiler does not
actually inline
a function (you may end up having multiple definitions of the same function)
Therefore, you have to check that the inline functions will actually be
inlined.,
and if they cannot be inlined, you must remove the inline specification."
My question is what does it mean with this This creates a problem if the
compiler does not actually inline
a function (you may end up having multiple definitions of the same function)
Therefore, you have to check that the inline functions will actually be
inlined,
and if they cannot be inlined, you must remove the inline specification.
Many thanks
//Tony