Skip to content

Commit

Permalink
Remove uses of BOOST_NO_IOSTREAM et al
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Sep 24, 2024
1 parent 694e682 commit d2c2407
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 78 deletions.
44 changes: 4 additions & 40 deletions include/boost/smart_ptr/intrusive_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,15 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//

#include <boost/config.hpp>

#include <boost/assert.hpp>
#include <boost/config/workaround.hpp>
#include <boost/smart_ptr/detail/sp_convertible.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>

#include <boost/config/no_tr1/functional.hpp> // for std::less

#if !defined(BOOST_NO_IOSTREAM)
#if !defined(BOOST_NO_IOSFWD)
#include <functional> // for std::less
#include <iosfwd> // for std::basic_ostream
#else
#include <ostream>
#endif
#endif


namespace boost
{
Expand Down Expand Up @@ -330,39 +321,12 @@ template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr<

// operator<<

#if !defined(BOOST_NO_IOSTREAM)

#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) )

template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y> const & p)
{
os << p.get();
return os;
}

#else

// in STLport's no-iostreams mode no iostream symbols can be used
#ifndef _STLP_NO_IOSTREAMS

# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT)
// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
using std::basic_ostream;
template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
# else
template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
# endif
{
os << p.get();
return os;
}

#endif // _STLP_NO_IOSTREAMS

#endif // __GNUC__ < 3

#endif // !defined(BOOST_NO_IOSTREAM)

// hash_value

template< class T > struct hash;
Expand Down
4 changes: 0 additions & 4 deletions include/boost/smart_ptr/local_shared_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,16 +660,12 @@ template<class T> inline typename local_shared_ptr<T>::element_type * get_pointe

// operator<<

#if !defined(BOOST_NO_IOSTREAM)

template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< ( std::basic_ostream<E, T> & os, local_shared_ptr<Y> const & p )
{
os << p.get();
return os;
}

#endif // !defined(BOOST_NO_IOSTREAM)

// get_deleter

template<class D, class T> D * get_deleter( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
Expand Down
34 changes: 0 additions & 34 deletions include/boost/smart_ptr/shared_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@
#include <typeinfo> // for std::bad_cast
#include <cstddef> // for std::size_t
#include <memory> // for std::auto_ptr

#if !defined(BOOST_NO_IOSTREAM)
#if !defined(BOOST_NO_IOSFWD)
#include <iosfwd> // for std::basic_ostream
#else
#include <ostream>
#endif
#endif

#if defined( BOOST_SP_DISABLE_DEPRECATED )
#pragma GCC diagnostic push
Expand Down Expand Up @@ -1001,39 +994,12 @@ template<class T> inline typename shared_ptr<T>::element_type * get_pointer(shar

// operator<<

#if !defined(BOOST_NO_IOSTREAM)

#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) )

template<class Y> std::ostream & operator<< (std::ostream & os, shared_ptr<Y> const & p)
{
os << p.get();
return os;
}

#else

// in STLport's no-iostreams mode no iostream symbols can be used
#ifndef _STLP_NO_IOSTREAMS

# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT)
// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
using std::basic_ostream;
template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, shared_ptr<Y> const & p)
# else
template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, shared_ptr<Y> const & p)
# endif
{
os << p.get();
return os;
}

#endif // _STLP_NO_IOSTREAMS

#endif // __GNUC__ < 3

#endif // !defined(BOOST_NO_IOSTREAM)

// get_deleter

namespace detail
Expand Down

0 comments on commit d2c2407

Please sign in to comment.