S
sks
All,
I thought all template instantiations were inlined until I analyzed the
following code.
template<typename t>
class Something
{
public:
inline int getSomething() { return 1; }
int getAnother();
};
template<typename t>
int Something<t>::getAnother()
{
return 2;
}
(I may not have the syntax exactly correct here since I am not
copying/pasting the code that I tested at work today).
Anyway, when I analyzed the assembly code, the compiler generated a symbol
for "getSomething" but there wasn't one for "getAnother" (it seemed to be
inlined).
Can we conclude from this that all templates are not inlined?
Thanks.
I thought all template instantiations were inlined until I analyzed the
following code.
template<typename t>
class Something
{
public:
inline int getSomething() { return 1; }
int getAnother();
};
template<typename t>
int Something<t>::getAnother()
{
return 2;
}
(I may not have the syntax exactly correct here since I am not
copying/pasting the code that I tested at work today).
Anyway, when I analyzed the assembly code, the compiler generated a symbol
for "getSomething" but there wasn't one for "getAnother" (it seemed to be
inlined).
Can we conclude from this that all templates are not inlined?
Thanks.