Hi, I have a problem with my code. I have template and Im using it for a wchar_t T parameter.
1 2 3 4 5 6 7 8 9 10 11 12 13
template <class T>
class ValueTemplate
{
public:
T value;
friend std::wofstream& operator<< (std::wofstream& out, Temp<T>& v)
{
out << v.value;
return out;
}
};
Problem:
I have a error:
C2679: binary '<<' : no operator found which takes a right-hand operand of type 'T' (or there is no acceptable conversion.
I was trying change it to const, non-reference, but everytime I have this error message.
When I change it for a ofstream, everything works great with no errors.