Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:06

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_TO_STRING_HPP_INCLUDED
0009 #define CATCH_TO_STRING_HPP_INCLUDED
0010 
0011 #include <string>
0012 
0013 #include <catch2/internal/catch_compiler_capabilities.hpp>
0014 #include <catch2/internal/catch_reusable_string_stream.hpp>
0015 
0016 namespace Catch {
0017     template <typename T>
0018     std::string to_string(T const& t) {
0019 #if defined(CATCH_CONFIG_CPP11_TO_STRING)
0020         return std::to_string(t);
0021 #else
0022         ReusableStringStream rss;
0023         rss << t;
0024         return rss.str();
0025 #endif
0026     }
0027 } // end namespace Catch
0028 
0029 #endif // CATCH_TO_STRING_HPP_INCLUDED