R
Robert Allan Schwartz
Starting with:
// a primary function template:
template <typename T>
inline
void dumb(T & x)
{
x = 1;
}
What is the difference between:
// A:
// a fully specialized function template:
template <>
inline
void dumb(int & x)
{
x = 2;
}
and:
// B:
// a function non-template:
inline
void dumb(int & x)
{
x = 2;
}
What would make me choose A versus B, or vice versa?
Thanks for your help!
Robert Schwartz
// a primary function template:
template <typename T>
inline
void dumb(T & x)
{
x = 1;
}
What is the difference between:
// A:
// a fully specialized function template:
template <>
inline
void dumb(int & x)
{
x = 2;
}
and:
// B:
// a function non-template:
inline
void dumb(int & x)
{
x = 2;
}
What would make me choose A versus B, or vice versa?
Thanks for your help!
Robert Schwartz