R
Rene Ivon Shamberger
Does std::stringstream work with templates, say for instance
void someMethod(int i){
std::string s;
std::stringstream out;
out << i;
s = out.str();
....
}
could be written like this:
template< typename T>
void someMethod(const T& data){
std::string s;
std::stringstream out;
out << data; //<<-- here is the majic would-be
s = out.str();
....
}
However, it seems that std::stringstream does not know templates, or does it. Maybe I am writing the code wrong! Any body?
TIA
void someMethod(int i){
std::string s;
std::stringstream out;
out << i;
s = out.str();
....
}
could be written like this:
template< typename T>
void someMethod(const T& data){
std::string s;
std::stringstream out;
out << data; //<<-- here is the majic would-be
s = out.str();
....
}
However, it seems that std::stringstream does not know templates, or does it. Maybe I am writing the code wrong! Any body?
TIA