I wrote a template function that converts any numerical value to string :
template <class T>
string ConverttoS(T input)
{
std::stringstream out;
out << input ;
return out.str();
}
now i want to use this template function inside a class , but if i did so i would be forced to edit all the class member functions . i.e can i make a certain member function template without rewwriting the whole class.
another problem is that even if i modified the whole class i would be forced to write :
A <int> object1;
for example
can i simply put it in global domain(i mean outside the class) and then call it . but is'nt this against encapsulation
thanks alot