1 // boost/chrono/utility/to_string.hpp
3 // Copyright 2011 Vicente J. Botet Escriba
4 // Use, modification and distribution are subject to the Boost Software License,
5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt).
8 #ifndef BOOST_CHRONO_UTILITY_TO_STRING_HPP
9 #define BOOST_CHRONO_UTILITY_TO_STRING_HPP
11 #include <boost/chrono/config.hpp>
19 template <typename CharT, typename T>
20 std::basic_string<CharT> to_basic_string(T const&v) {
21 std::basic_stringstream<CharT> sstr;
27 std::string to_string(T const&v) {
28 return to_basic_string<char>(v);
30 #ifndef BOOST_NO_STD_WSTRING
32 std::wstring to_wstring(T const&v) {
33 return to_basic_string<wchar_t>(v);
36 #if BOOST_CHRONO_HAS_UNICODE_SUPPORT
38 std::basic_string<char16_t> to_u16string(T const&v) {
39 return to_basic_string<char16_t>(v);
42 std::basic_string<char32_t> to_u32string(T const&v) {
43 return to_basic_string<char32_t>(v);