Chris@16: // Boost.Range library Chris@16: // Chris@16: // Copyright Neil Groves 2009. Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // For more information, see http://www.boost.org/libs/range/ Chris@16: // Chris@16: #ifndef BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED Chris@16: #define BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) Chris@16: #pragma warning( push ) Chris@16: #pragma warning( disable : 4996 ) Chris@16: #endif Chris@16: Chris@16: // From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch. Chris@16: #ifndef BOOST_OLD_IOSTREAMS Chris@16: # if defined(__STL_CONFIG_H) && \ Chris@16: !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \ Chris@16: /**/ Chris@16: # define BOOST_OLD_IOSTREAMS Chris@16: # endif Chris@16: #endif // #ifndef BOOST_OLD_IOSTREAMS Chris@16: Chris@16: #ifndef _STLP_NO_IOSTREAMS Chris@16: # ifndef BOOST_OLD_IOSTREAMS Chris@16: # include Chris@16: # else Chris@16: # include Chris@16: # endif Chris@16: #endif // _STLP_NO_IOSTREAMS Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: Chris@16: #ifndef _STLP_NO_IOSTREAMS Chris@16: # ifndef BOOST_OLD_IOSTREAMS Chris@16: Chris@16: //! iterator_range output operator Chris@16: /*! Chris@16: Output the range to an ostream. Elements are outputted Chris@16: in a sequence without separators. Chris@16: */ Chris@16: template< typename IteratorT, typename Elem, typename Traits > Chris@16: inline std::basic_ostream& operator<<( Chris@16: std::basic_ostream& Os, Chris@16: const iterator_range& r ) Chris@16: { Chris@16: std::copy( r.begin(), r.end(), Chris@16: std::ostream_iterator< BOOST_DEDUCED_TYPENAME Chris@16: iterator_value::type, Chris@16: Elem, Traits>(Os) ); Chris@16: return Os; Chris@16: } Chris@16: Chris@16: # else Chris@16: Chris@16: //! iterator_range output operator Chris@16: /*! Chris@16: Output the range to an ostream. Elements are outputted Chris@16: in a sequence without separators. Chris@16: */ Chris@16: template< typename IteratorT > Chris@16: inline std::ostream& operator<<( Chris@16: std::ostream& Os, Chris@16: const iterator_range& r ) Chris@16: { Chris@16: std::copy( r.begin(), r.end(), std::ostream_iterator(Os)); Chris@16: return Os; Chris@16: } Chris@16: Chris@16: # endif Chris@16: #endif // _STLP_NO_IOSTREAMS Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #undef BOOST_OLD_IOSTREAMS Chris@16: Chris@16: #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) Chris@16: #pragma warning(pop) Chris@16: #endif Chris@16: Chris@16: #endif // include guard