Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:18

0001 // Boost.Range library
0002 //
0003 //  Copyright Neil Groves 2009.
0004 //  Use, modification and distribution is subject to the Boost Software
0005 //  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0006 //  http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // For more information, see http://www.boost.org/libs/range/
0009 //
0010 #ifndef BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED
0011 #define BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED
0012 
0013 #include <boost/config.hpp>
0014 #include <boost/detail/workaround.hpp>
0015 
0016 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
0017     #pragma warning( push )
0018     #pragma warning( disable : 4996 )
0019 #endif
0020 
0021 // From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch.
0022 #ifndef BOOST_OLD_IOSTREAMS 
0023 # if defined(__STL_CONFIG_H) && \
0024     !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \
0025     /**/
0026 #  define BOOST_OLD_IOSTREAMS
0027 # endif
0028 #endif // #ifndef BOOST_OLD_IOSTREAMS
0029 
0030 #ifndef _STLP_NO_IOSTREAMS
0031 # ifndef BOOST_OLD_IOSTREAMS
0032 #  include <ostream>
0033 # else
0034 #  include <ostream.h>
0035 # endif
0036 #endif // _STLP_NO_IOSTREAMS
0037 
0038 #include <boost/range/iterator_range_core.hpp>
0039 #include <iterator>
0040 #include <algorithm>
0041 #include <cstddef>
0042 
0043 namespace boost
0044 {
0045 
0046 #ifndef _STLP_NO_IOSTREAMS
0047 # ifndef BOOST_OLD_IOSTREAMS   
0048 
0049         //! iterator_range output operator
0050         /*!
0051             Output the range to an ostream. Elements are outputted
0052             in a sequence without separators.
0053         */
0054         template< typename IteratorT, typename Elem, typename Traits >
0055         inline std::basic_ostream<Elem,Traits>& operator<<( 
0056                     std::basic_ostream<Elem, Traits>& Os,
0057                     const iterator_range<IteratorT>& r )
0058         {
0059             std::copy( r.begin(), r.end(), 
0060                        std::ostream_iterator< BOOST_DEDUCED_TYPENAME 
0061                                               iterator_value<IteratorT>::type, 
0062                                               Elem, Traits>(Os) );
0063             return Os;
0064         }
0065 
0066 # else
0067 
0068         //! iterator_range output operator
0069         /*!
0070             Output the range to an ostream. Elements are outputted
0071             in a sequence without separators.
0072         */
0073         template< typename IteratorT >
0074         inline std::ostream& operator<<( 
0075                     std::ostream& Os,
0076                     const iterator_range<IteratorT>& r )
0077         {
0078             std::copy( r.begin(), r.end(), std::ostream_iterator<char>(Os));
0079             return Os;
0080         }
0081 
0082 # endif
0083 #endif // _STLP_NO_IOSTREAMS
0084 
0085 } // namespace boost
0086 
0087 #undef BOOST_OLD_IOSTREAMS
0088 
0089 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
0090     #pragma warning(pop)
0091 #endif
0092 
0093 #endif // include guard