Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/chrono/io/utility/to_string.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | 2665513ce2d3 |
children |
rev | line source |
---|---|
Chris@16 | 1 // boost/chrono/utility/to_string.hpp |
Chris@16 | 2 // |
Chris@16 | 3 // Copyright 2011 Vicente J. Botet Escriba |
Chris@16 | 4 // Use, modification and distribution are subject to the Boost Software License, |
Chris@16 | 5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 6 // http://www.boost.org/LICENSE_1_0.txt). |
Chris@16 | 7 |
Chris@16 | 8 #ifndef BOOST_CHRONO_UTILITY_TO_STRING_HPP |
Chris@16 | 9 #define BOOST_CHRONO_UTILITY_TO_STRING_HPP |
Chris@16 | 10 |
Chris@16 | 11 #include <boost/chrono/config.hpp> |
Chris@16 | 12 #include <string> |
Chris@16 | 13 #include <sstream> |
Chris@16 | 14 |
Chris@16 | 15 namespace boost |
Chris@16 | 16 { |
Chris@16 | 17 namespace chrono |
Chris@16 | 18 { |
Chris@16 | 19 template <typename CharT, typename T> |
Chris@16 | 20 std::basic_string<CharT> to_basic_string(T const&v) { |
Chris@16 | 21 std::basic_stringstream<CharT> sstr; |
Chris@16 | 22 sstr << v; |
Chris@16 | 23 return sstr.str(); |
Chris@16 | 24 } |
Chris@16 | 25 |
Chris@16 | 26 template <typename T> |
Chris@16 | 27 std::string to_string(T const&v) { |
Chris@16 | 28 return to_basic_string<char>(v); |
Chris@16 | 29 } |
Chris@16 | 30 #ifndef BOOST_NO_STD_WSTRING |
Chris@16 | 31 template <typename T> |
Chris@16 | 32 std::wstring to_wstring(T const&v) { |
Chris@16 | 33 return to_basic_string<wchar_t>(v); |
Chris@16 | 34 } |
Chris@16 | 35 #endif |
Chris@16 | 36 #if BOOST_CHRONO_HAS_UNICODE_SUPPORT |
Chris@16 | 37 template <typename T> |
Chris@16 | 38 std::basic_string<char16_t> to_u16string(T const&v) { |
Chris@16 | 39 return to_basic_string<char16_t>(v); |
Chris@16 | 40 } |
Chris@16 | 41 template <typename T> |
Chris@16 | 42 std::basic_string<char32_t> to_u32string(T const&v) { |
Chris@16 | 43 return to_basic_string<char32_t>(v); |
Chris@16 | 44 } |
Chris@16 | 45 #endif |
Chris@16 | 46 } // chrono |
Chris@16 | 47 |
Chris@16 | 48 } // boost |
Chris@16 | 49 |
Chris@16 | 50 #endif // header |