Skip to content
Snippets Groups Projects
Commit 1540423f authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[common.string.whitespaceify] be a little more flexible

parent ecc9e32f
No related branches found
No related tags found
No related merge requests found
...@@ -56,8 +56,10 @@ inline std::string toString(const ReturnType& s) ...@@ -56,8 +56,10 @@ inline std::string toString(const ReturnType& s)
\return std::string \return std::string
Returns a string of lengths s' whitespace (or c chars). Returns a string of lengths s' whitespace (or c chars).
**/ **/
std::string whitespaceify(const std::string s, const char whitespace = ' ') template <class T>
std::string whitespaceify(const T& t, const char whitespace = ' ')
{ {
const std::string s = toString<T>(t);
std::string ret = ""; std::string ret = "";
for (unsigned int i = 0; i < s.size(); ++i) { for (unsigned int i = 0; i < s.size(); ++i) {
ret += whitespace; ret += whitespace;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment