File indexing completed on 2025-01-18 09:52:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_TEST_UTILS_BASIC_CSTRING_IO_HPP
0016 #define BOOST_TEST_UTILS_BASIC_CSTRING_IO_HPP
0017
0018
0019 #include <boost/test/utils/basic_cstring/basic_cstring.hpp>
0020
0021
0022 #include <iosfwd>
0023 #include <string>
0024
0025 #include <boost/test/detail/suppress_warnings.hpp>
0026
0027
0028
0029 namespace boost {
0030
0031 namespace unit_test {
0032
0033 #ifdef BOOST_CLASSIC_IOSTREAMS
0034
0035 template<typename CharT>
0036 inline std::ostream&
0037 operator<<( std::ostream& os, basic_cstring<CharT> const& str )
0038 {
0039 typedef typename ut_detail::bcs_base_char<CharT>::type char_type;
0040 char_type const* const beg = reinterpret_cast<char_type const* const>( str.begin() );
0041 char_type const* const end = reinterpret_cast<char_type const* const>( str.end() );
0042 os << std::basic_string<char_type>( beg, end - beg );
0043
0044 return os;
0045 }
0046
0047 #else
0048
0049 template<typename CharT1, typename Tr,typename CharT2>
0050 inline std::basic_ostream<CharT1,Tr>&
0051 operator<<( std::basic_ostream<CharT1,Tr>& os, basic_cstring<CharT2> const& str )
0052 {
0053 CharT1 const* const beg = reinterpret_cast<CharT1 const*>( str.begin() );
0054 CharT1 const* const end = reinterpret_cast<CharT1 const*>( str.end() );
0055 os << std::basic_string<CharT1,Tr>( beg, end - beg );
0056
0057 return os;
0058 }
0059
0060 #endif
0061
0062
0063
0064
0065 }
0066
0067 }
0068
0069
0070
0071 #include <boost/test/detail/enable_warnings.hpp>
0072
0073 #endif