about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc8
-rw-r--r--src/libutil/util.hh7
2 files changed, 6 insertions, 9 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index bc07a84f4d8d..5a88a158c389 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -1083,14 +1083,6 @@ bool statusOk(int status)
 }
 
 
-string int2String(int n)
-{
-    std::ostringstream str;
-    str << n;
-    return str.str();
-}
-
-
 bool hasSuffix(const string & s, const string & suffix)
 {
     return s.size() >= suffix.size() && string(s, s.size() - suffix.size()) == suffix;
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 6c83987c5d46..86c65b763d00 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -319,7 +319,12 @@ template<class N> bool string2Int(const string & s, N & n)
     return str && str.get() == EOF;
 }
 
-string int2String(int n);
+template<class N> string int2String(N n)
+{
+    std::ostringstream str;
+    str << n;
+    return str.str();
+}
 
 
 /* Return true iff `s' ends in `suffix'. */