M
MiG
Hello,
I would like to know if including the body of a function in its class
declaration results in the function being inlined.
In other words, is the following code...
template <typename T>
class foo
{
void foobar(T arg)
{
_data = arg;
}
.
:
.
};
.... equivalent to:
template <typename T>
class foo
{
inline void foobar(T arg);
.
:
.
};
template <typename T>
inline void foo<T>::foobar(T arg)
{
_data = arg;
}
I would like to know if including the body of a function in its class
declaration results in the function being inlined.
In other words, is the following code...
template <typename T>
class foo
{
void foobar(T arg)
{
_data = arg;
}
.
:
.
};
.... equivalent to:
template <typename T>
class foo
{
inline void foobar(T arg);
.
:
.
};
template <typename T>
inline void foo<T>::foobar(T arg)
{
_data = arg;
}