mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-10 11:26:56 +01:00
function to convert std::vector to string
This commit is contained in:
@ -423,4 +423,17 @@ namespace Grid {
|
||||
}
|
||||
}
|
||||
|
||||
// helper function to read space-separated values
|
||||
template <typename T>
|
||||
std::string vecToStr(const std::vector<T> &v)
|
||||
{
|
||||
using Grid::operator<<;
|
||||
|
||||
std::ostringstream sstr;
|
||||
|
||||
sstr << v;
|
||||
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user