Ticket #2103: 2103.patch

File 2103.patch, 1.9 KB (added by nasonov, 14 years ago)

Patch (not against the latest version in the trunk) that fixes #2103 and also fixes incorrect uses of BOOST_NO_TEMPLATED_STREAMS.

  • boost/optional/optional_fwd.hpp

    old new  
    1212#ifndef BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
    1313#define BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
    1414
     15#include <iosfwd>
     16
    1517namespace boost {
    1618
    1719template<class T> class optional ;
    1820
     21// TODO: Add BOOST_NO_TEMPLATED_STREAMS to config framework and change
     22// this and other libraries that use BOOST_NO_TEMPLATED_STREAMS.
     23#if defined __GNUC__
     24#  if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
     25#    define BOOST_OPTIONAL_NO_TEMPLATED_STREAMS
     26#  endif
     27#endif // __GNUC__
     28
     29#if defined (BOOST_OPTIONAL_NO_TEMPLATED_STREAMS)
     30std::ostream& operator<<(std::ostream& out, optional<T> const& v);
     31#else
     32template<class CharType, class CharTrait, class T>
     33std::basic_ostream<CharType, CharTrait>&
     34operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v);
     35#endif
     36
    1937} // namespace boost
    2038
    2139#endif
  • boost/optional/optional_io.hpp

    old new  
    1212#ifndef BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
    1313#define BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
    1414
    15 #if defined __GNUC__
    16 #  if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
    17 #    define BOOST_OPTIONAL_NO_TEMPLATED_STREAMS
    18 #  endif
    19 #endif // __GNUC__
    20 
    2115#if defined BOOST_OPTIONAL_NO_TEMPLATED_STREAMS
    2216#  include <iostream>
    2317#else
     
    3226namespace boost
    3327{
    3428
    35 #if defined (BOOST_NO_TEMPLATED_STREAMS)
     29#if defined (BOOST_OPTIONAL_NO_TEMPLATED_STREAMS)
    3630template<class T>
    3731inline std::ostream& operator<<(std::ostream& out, optional<T> const& v)
    3832#else
     
    5246  return out;
    5347}
    5448
    55 #if defined (BOOST_NO_TEMPLATED_STREAMS)
     49#if defined (BOOST_OPTIONAL_NO_TEMPLATED_STREAMS)
    5650template<class T>
    5751inline std::istream& operator>>(std::istream& in, optional<T>& v)
    5852#else