3 // Copyright Neil Groves 2009.
4 // Use, modification and distribution is subject to the Boost Software
5 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // For more information, see http://www.boost.org/libs/range/
10 #ifndef BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED
11 #define BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED
13 #include <boost/config.hpp>
14 #include <boost/detail/workaround.hpp>
16 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
17 #pragma warning( push )
18 #pragma warning( disable : 4996 )
21 // From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch.
22 #ifndef BOOST_OLD_IOSTREAMS
23 # if defined(__STL_CONFIG_H) && \
24 !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \
26 # define BOOST_OLD_IOSTREAMS
28 #endif // #ifndef BOOST_OLD_IOSTREAMS
30 #ifndef _STLP_NO_IOSTREAMS
31 # ifndef BOOST_OLD_IOSTREAMS
36 #endif // _STLP_NO_IOSTREAMS
38 #include <boost/range/iterator_range_core.hpp>
46 #ifndef _STLP_NO_IOSTREAMS
47 # ifndef BOOST_OLD_IOSTREAMS
49 //! iterator_range output operator
51 Output the range to an ostream. Elements are outputted
52 in a sequence without separators.
54 template< typename IteratorT, typename Elem, typename Traits >
55 inline std::basic_ostream<Elem,Traits>& operator<<(
56 std::basic_ostream<Elem, Traits>& Os,
57 const iterator_range<IteratorT>& r )
59 std::copy( r.begin(), r.end(),
60 std::ostream_iterator< BOOST_DEDUCED_TYPENAME
61 iterator_value<IteratorT>::type,
68 //! iterator_range output operator
70 Output the range to an ostream. Elements are outputted
71 in a sequence without separators.
73 template< typename IteratorT >
74 inline std::ostream& operator<<(
76 const iterator_range<IteratorT>& r )
78 std::copy( r.begin(), r.end(), std::ostream_iterator<char>(Os));
83 #endif // _STLP_NO_IOSTREAMS
87 #undef BOOST_OLD_IOSTREAMS
89 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
93 #endif // include guard