Suppose I have the following class:
template <typename T>
class MyClass
{
public:
void SetValue(const T &value) { m_value = value; }
private:
T m_value;
};
How can I write a specialized version of the function, for T=float (or any other type)?
Note: A simple overload won’t suffice because I only want the function to be available for T=float (i.e. MyClass::SetValue(float) doesn’t make any sense in this instance).
or (partial template specialization):
or, if you want the functions to have different signatures