about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-19T19·43-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-19T19·43-0400
commit76e88871b21c47c0216e160a5fb926f763ba64fe (patch)
tree815918838ee85fc3c655c55d6aca11c8a36bb502 /src/libutil/util.cc
parent00092b2d356293a7af9d4d8125a689f90c461591 (diff)
Templatise tokenizeString()
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 56bf5875deaa..7f95d398147f 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -984,9 +984,9 @@ void _interrupted()
 //////////////////////////////////////////////////////////////////////
 
 
-Strings tokenizeString(const string & s, const string & separators)
+template<class C> C tokenizeString(const string & s, const string & separators)
 {
-    Strings result;
+    C result;
     string::size_type pos = s.find_first_not_of(separators, 0);
     while (pos != string::npos) {
         string::size_type end = s.find_first_of(separators, pos + 1);
@@ -998,6 +998,9 @@ Strings tokenizeString(const string & s, const string & separators)
     return result;
 }
 
+template Strings tokenizeString(const string & s, const string & separators);
+template vector<string> tokenizeString(const string & s, const string & separators);
+
 
 string concatStringsSep(const string & sep, const Strings & ss)
 {