1 // (C) Copyright Gennadiy Rozental 2001.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
10 // Version : $Revision$
12 // Description : basic_cstring i/o implementation
13 // ***************************************************************************
15 #ifndef BOOST_TEST_UTILS_BASIC_CSTRING_IO_HPP
16 #define BOOST_TEST_UTILS_BASIC_CSTRING_IO_HPP
19 #include <boost/test/utils/basic_cstring/basic_cstring.hpp>
25 #include <boost/test/detail/suppress_warnings.hpp>
27 //____________________________________________________________________________//
33 #ifdef BOOST_CLASSIC_IOSTREAMS
35 template<typename CharT>
37 operator<<( std::ostream& os, basic_cstring<CharT> const& str )
39 typedef typename ut_detail::bcs_base_char<CharT>::type char_type;
40 char_type const* const beg = reinterpret_cast<char_type const* const>( str.begin() );
41 char_type const* const end = reinterpret_cast<char_type const* const>( str.end() );
42 os << std::basic_string<char_type>( beg, end - beg );
49 template<typename CharT1, typename Tr,typename CharT2>
50 inline std::basic_ostream<CharT1,Tr>&
51 operator<<( std::basic_ostream<CharT1,Tr>& os, basic_cstring<CharT2> const& str )
53 CharT1 const* const beg = reinterpret_cast<CharT1 const*>( str.begin() ); // !!
54 CharT1 const* const end = reinterpret_cast<CharT1 const*>( str.end() );
55 os << std::basic_string<CharT1,Tr>( beg, end - beg );
62 //____________________________________________________________________________//
65 } // namespace unit_test
69 //____________________________________________________________________________//
71 #include <boost/test/detail/enable_warnings.hpp>
73 #endif // BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER