Index: src/Common/DeclStats.cpp
===================================================================
--- src/Common/DeclStats.cpp	(revision c94b1f0c9aec80a9115515dae21e3c5d8eb2d797)
+++ src/Common/DeclStats.cpp	(revision bb7422a92c2e0bb9b901b7099d87e5736fed1d23)
@@ -23,4 +23,5 @@
 #include <iostream>
 #include <map>
+#include <sstream>
 #include <unordered_map>
 #include <unordered_set>
Index: src/Common/ResolvProtoDump.cpp
===================================================================
--- src/Common/ResolvProtoDump.cpp	(revision c94b1f0c9aec80a9115515dae21e3c5d8eb2d797)
+++ src/Common/ResolvProtoDump.cpp	(revision bb7422a92c2e0bb9b901b7099d87e5736fed1d23)
@@ -19,4 +19,5 @@
 #include <iostream>
 #include <set>
+#include <sstream>
 #include <unordered_set>
 
@@ -26,5 +27,4 @@
 #include "AST/Type.hpp"
 #include "CodeGen/OperatorTable.h"
-#include "Common/utility.h"
 
 namespace {
Index: src/Common/ToString.hpp
===================================================================
--- src/Common/ToString.hpp	(revision bb7422a92c2e0bb9b901b7099d87e5736fed1d23)
+++ src/Common/ToString.hpp	(revision bb7422a92c2e0bb9b901b7099d87e5736fed1d23)
@@ -0,0 +1,31 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// ToString.hpp -- Tools to convert to string.
+//
+// Author           : Andrew Beach
+// Created On       : Tue Mar 28  9:24:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Tue Mar 28  9:24:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+#include <string>
+#include <sstream>
+
+/// Convert all arguments to strings and concatenate them.
+template<typename... Params>
+std::string toString( const Params &... params ) {
+	std::ostringstream buffer;
+	(buffer << ... << params);
+	return buffer.str();
+}
+
+/// Convert all arguments to a C-string.
+/// It is a macro so that a underlying std::string manages the memory.
+#define toCString( ... ) toString( __VA_ARGS__ ).c_str()
Index: src/Common/module.mk
===================================================================
--- src/Common/module.mk	(revision c94b1f0c9aec80a9115515dae21e3c5d8eb2d797)
+++ src/Common/module.mk	(revision bb7422a92c2e0bb9b901b7099d87e5736fed1d23)
@@ -52,4 +52,5 @@
 	Common/Stats/Time.cc \
 	Common/Stats/Time.h \
+	Common/ToString.hpp \
 	Common/UniqueName.cc \
 	Common/UniqueName.h \
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision c94b1f0c9aec80a9115515dae21e3c5d8eb2d797)
+++ src/Common/utility.h	(revision bb7422a92c2e0bb9b901b7099d87e5736fed1d23)
@@ -22,5 +22,4 @@
 #include <list>
 #include <memory>
-#include <sstream>
 #include <string>
 #include <type_traits>
@@ -143,24 +142,4 @@
 	dst.swap( src );
 }
-
-template < typename T >
-void toString_single( std::ostream & os, const T & value ) {
-	os << value;
-}
-
-template < typename T, typename... Params >
-void toString_single( std::ostream & os, const T & value, const Params & ... params ) {
-	os << value;
-	toString_single( os, params ... );
-}
-
-template < typename ... Params >
-std::string toString( const Params & ... params ) {
-	std::ostringstream os;
-	toString_single( os, params... );
-	return os.str();
-}
-
-#define toCString( ... ) toString( __VA_ARGS__ ).c_str()
 
 template< typename... Args >
