1 /* 2 * Created by Martin on 9/5/2018. 3 * 4 * Distributed under the Boost Software License, Version 1.0. (See accompanying 5 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 */ 7 #ifndef TWOBLUECUBES_CATCH_TO_STRING_H_INCLUDED 8 #define TWOBLUECUBES_CATCH_TO_STRING_H_INCLUDED 9 10 #include <string> 11 12 #include "catch_compiler_capabilities.h" 13 #include "catch_stream.h" 14 15 namespace Catch { 16 template <typename T> to_string(T const & t)17 std::string to_string(T const& t) { 18 #if defined(CATCH_CONFIG_CPP11_TO_STRING) 19 return std::to_string(t); 20 #else 21 ReusableStringStream rss; 22 rss << t; 23 return rss.str(); 24 #endif 25 } 26 } // end namespace Catch 27 28 #endif // TWOBLUECUBES_CATCH_TO_STRING_H_INCLUDED 29