Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86062 - in trunk/boost: fusion/sequence/io/detail lambda/detail optional smart_ptr tuple
From: steveire_at_[hidden]
Date: 2013-09-30 11:56:52


Author: skelly
Date: 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013)
New Revision: 86062
URL: http://svn.boost.org/trac/boost/changeset/86062

Log:
Remove use of obsolete BOOST_NO_TEMPLATED_STREAMS macro.

It was only defined for no-longer-supported-gcc.

Text files modified:
   trunk/boost/fusion/sequence/io/detail/manip.hpp | 54 ---------
   trunk/boost/lambda/detail/operator_return_type_traits.hpp | 31 -----
   trunk/boost/lambda/detail/operators.hpp | 18 ---
   trunk/boost/optional/optional_io.hpp | 10 -
   trunk/boost/smart_ptr/intrusive_ptr.hpp | 2
   trunk/boost/smart_ptr/shared_ptr.hpp | 2
   trunk/boost/tuple/tuple_io.hpp | 235 ----------------------------------------
   7 files changed, 2 insertions(+), 350 deletions(-)

Modified: trunk/boost/fusion/sequence/io/detail/manip.hpp
==============================================================================
--- trunk/boost/fusion/sequence/io/detail/manip.hpp Mon Sep 30 11:56:04 2013 (r86061)
+++ trunk/boost/fusion/sequence/io/detail/manip.hpp 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013) (r86062)
@@ -19,15 +19,11 @@
 #define FUSION_GET_CHAR_TYPE(T) typename T::char_type
 #define FUSION_GET_TRAITS_TYPE(T) typename T::traits_type
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-#define FUSION_STRING_OF_STREAM(Stream) std::string
-#else
 #define FUSION_STRING_OF_STREAM(Stream) \
     std::basic_string< \
         FUSION_GET_CHAR_TYPE(Stream) \
       , FUSION_GET_TRAITS_TYPE(Stream) \
>
-#endif
 
 //$$$ these should be part of the public API$$$
 //$$$ rename tuple_open, tuple_close and tuple_delimiter to
@@ -154,55 +150,6 @@
 
     } // detail
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-
-#define STD_TUPLE_DEFINE_MANIPULATOR(name) \
- namespace detail \
- { \
- struct name##_tag; \
- \
- struct name##_type \
- { \
- typedef std::string string_type; \
- string_type data; \
- name##_type(const string_type& d): data(d) {} \
- }; \
- \
- template <typename Stream> \
- Stream& operator>>(Stream& s, const name##_type& m) \
- { \
- string_ios_manip<name##_tag, Stream>(s).set(m.data); \
- return s; \
- } \
- \
- template <typename Stream> \
- Stream& operator<<(Stream& s, const name##_type& m) \
- { \
- string_ios_manip<name##_tag, Stream>(s).set(m.data); \
- return s; \
- } \
- }
-
-#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \
- inline detail::name##_type \
- name(const std::string& s) \
- { \
- return detail::name##_type(s); \
- } \
- \
- inline detail::name##_type \
- name(const char* s) \
- { \
- return detail::name##_type(std::string(s)); \
- } \
- \
- inline detail::name##_type \
- name(char c) \
- { \
- return detail::name##_type(std::string(1, c)); \
- }
-
-#else // defined(BOOST_NO_TEMPLATED_STREAMS)
 
 #if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
 
@@ -299,7 +246,6 @@
         } \
     } \
 
-#endif // defined(BOOST_NO_TEMPLATED_STREAMS)
 
     STD_TUPLE_DEFINE_MANIPULATOR(tuple_open)
     STD_TUPLE_DEFINE_MANIPULATOR(tuple_close)

Modified: trunk/boost/lambda/detail/operator_return_type_traits.hpp
==============================================================================
--- trunk/boost/lambda/detail/operator_return_type_traits.hpp Mon Sep 30 11:56:04 2013 (r86061)
+++ trunk/boost/lambda/detail/operator_return_type_traits.hpp 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013) (r86062)
@@ -536,36 +536,6 @@
 
 namespace detail {
 
-#ifdef BOOST_NO_TEMPLATED_STREAMS
-
-template<class A, class B>
-struct leftshift_type {
-
- typedef typename detail::IF<
- boost::is_convertible<
- typename boost::remove_reference<A>::type*,
- std::ostream*
- >::value,
- std::ostream&,
- typename detail::remove_reference_and_cv<A>::type
- >::RET type;
-};
-
-template<class A, class B>
-struct rightshift_type {
-
- typedef typename detail::IF<
-
- boost::is_convertible<
- typename boost::remove_reference<A>::type*,
- std::istream*
- >::value,
- std::istream&,
- typename detail::remove_reference_and_cv<A>::type
- >::RET type;
-};
-
-#else
 
 template <class T> struct get_ostream_type {
   typedef std::basic_ostream<typename T::char_type,
@@ -602,7 +572,6 @@
 };
 
 
-#endif
 
 } // end detail
 

Modified: trunk/boost/lambda/detail/operators.hpp
==============================================================================
--- trunk/boost/lambda/detail/operators.hpp Mon Sep 30 11:56:04 2013 (r86061)
+++ trunk/boost/lambda/detail/operators.hpp 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013) (r86062)
@@ -161,23 +161,6 @@
 
 // Note that the overloading is const vs. non-const first argument
 
-#ifdef BOOST_NO_TEMPLATED_STREAMS
-template<class T> struct convert_ostream_to_ref_others_to_c_plain_by_default {
- typedef typename detail::IF<
- boost::is_convertible<T*, std::ostream*>::value,
- T&,
- typename const_copy_argument <T>::type
- >::RET type;
-};
-
-template<class T> struct convert_istream_to_ref_others_to_c_plain_by_default {
- typedef typename detail::IF<
- boost::is_convertible<T*, std::istream*>::value,
- T&,
- typename const_copy_argument <T>::type
- >::RET type;
-};
-#else
 
 template<class T> struct convert_ostream_to_ref_others_to_c_plain_by_default {
   typedef typename detail::IF<
@@ -198,7 +181,6 @@
                        typename const_copy_argument <T>::type
>::RET type;
 };
-#endif
 
 } // detail
 

Modified: trunk/boost/optional/optional_io.hpp
==============================================================================
--- trunk/boost/optional/optional_io.hpp Mon Sep 30 11:56:04 2013 (r86061)
+++ trunk/boost/optional/optional_io.hpp 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013) (r86062)
@@ -33,15 +33,10 @@
 namespace boost
 {
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-template<class T>
-inline std::ostream& operator<<(std::ostream& out, optional<T> const& v)
-#else
 template<class CharType, class CharTrait, class T>
 inline
 std::basic_ostream<CharType, CharTrait>&
 operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v)
-#endif
 {
   if ( out.good() )
   {
@@ -53,15 +48,10 @@
   return out;
 }
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-template<class T>
-inline std::istream& operator>>(std::istream& in, optional<T>& v)
-#else
 template<class CharType, class CharTrait, class T>
 inline
 std::basic_istream<CharType, CharTrait>&
 operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
-#endif
 {
   if (in.good())
   {

Modified: trunk/boost/smart_ptr/intrusive_ptr.hpp
==============================================================================
--- trunk/boost/smart_ptr/intrusive_ptr.hpp Mon Sep 30 11:56:04 2013 (r86061)
+++ trunk/boost/smart_ptr/intrusive_ptr.hpp 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013) (r86062)
@@ -279,7 +279,7 @@
 
 #if !defined(BOOST_NO_IOSTREAM)
 
-#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) )
+#if ( defined(__GNUC__) && (__GNUC__ < 3) )
 
 template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y> const & p)
 {

Modified: trunk/boost/smart_ptr/shared_ptr.hpp
==============================================================================
--- trunk/boost/smart_ptr/shared_ptr.hpp Mon Sep 30 11:56:04 2013 (r86061)
+++ trunk/boost/smart_ptr/shared_ptr.hpp 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013) (r86062)
@@ -836,7 +836,7 @@
 
 #if !defined(BOOST_NO_IOSTREAM)
 
-#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) )
+#if ( defined(__GNUC__) && (__GNUC__ < 3) )
 
 template<class Y> std::ostream & operator<< (std::ostream & os, shared_ptr<Y> const & p)
 {

Modified: trunk/boost/tuple/tuple_io.hpp
==============================================================================
--- trunk/boost/tuple/tuple_io.hpp Mon Sep 30 11:56:04 2013 (r86061)
+++ trunk/boost/tuple/tuple_io.hpp 2013-09-30 11:56:52 EDT (Mon, 30 Sep 2013) (r86062)
@@ -13,21 +13,8 @@
 #ifndef BOOST_TUPLE_IO_HPP
 #define BOOST_TUPLE_IO_HPP
 
-
-// add to boost/config.hpp
-// for now
-# if defined __GNUC__
-# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
-#define BOOST_NO_TEMPLATED_STREAMS
-#endif
-#endif // __GNUC__
-
-#if defined BOOST_NO_TEMPLATED_STREAMS
-#include <iostream>
-#else
 #include <istream>
 #include <ostream>
-#endif
 
 #include <sstream>
 
@@ -76,25 +63,6 @@
 
 public:
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
- static char get_manipulator(std::ios& i, manipulator_type m) {
- char c = static_cast<char>(i.iword(get_stream_index(m)));
-
- // parentheses and space are the default manipulators
- if (!c) {
- switch(m) {
- case detail::format_info::open : c = '('; break;
- case detail::format_info::close : c = ')'; break;
- case detail::format_info::delimiter : c = ' '; break;
- }
- }
- return c;
- }
-
- static void set_manipulator(std::ios& i, manipulator_type m, char c) {
- i.iword(get_stream_index(m)) = static_cast<long>(c);
- }
-#else
    template<class CharType, class CharTrait>
    static CharType get_manipulator(std::basic_ios<CharType, CharTrait>& i,
                                    manipulator_type m) {
@@ -124,7 +92,6 @@
      // convertible long.
       i.iword(get_stream_index(m)) = static_cast<long>(c);
    }
-#endif // BOOST_NO_TEMPLATED_STREAMS
 };
 
 } // end of namespace detail
@@ -138,11 +105,6 @@
                              const char c = 0)
      : mt(m), f_c(c) {}
   
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
- void set(std::ios &io) const {
- detail::format_info::set_manipulator(io, mt, f_c);
- }
-#else
 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
    template<class CharType2, class CharTrait>
   void set(std::basic_ios<CharType2, CharTrait> &io) const {
@@ -154,23 +116,8 @@
      detail::format_info::set_manipulator(io, mt, f_c);
   }
 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#endif // BOOST_NO_TEMPLATED_STREAMS
 };
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-inline std::ostream&
-operator<<(std::ostream& o, const tuple_manipulator<char>& m) {
- m.set(o);
- return o;
-}
-
-inline std::istream&
-operator>>(std::istream& i, const tuple_manipulator<char>& m) {
- m.set(i);
- return i;
-}
-
-#else
 
 template<class CharType, class CharTrait>
 inline std::basic_ostream<CharType, CharTrait>&
@@ -186,7 +133,6 @@
   return i;
 }
 
-#endif // BOOST_NO_TEMPLATED_STREAMS
    
 template<class CharType>
 inline tuple_manipulator<CharType> set_open(const CharType c) {
@@ -217,54 +163,6 @@
 // Note: The order of the print functions is critical
 // to let a conforming compiler find and select the correct one.
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-template<class T1>
-inline std::ostream& print(std::ostream& o, const cons<T1, null_type>& t) {
- return o << t.head;
-}
-#endif // BOOST_NO_TEMPLATED_STREAMS
-
-inline std::ostream& print(std::ostream& o, const null_type&) { return o; }
-
-template<class T1, class T2>
-inline std::ostream&
-print(std::ostream& o, const cons<T1, T2>& t) {
-
- const char d = format_info::get_manipulator(o, format_info::delimiter);
-
- o << t.head;
-
-#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
- if (tuples::length<T2>::value == 0)
- return o;
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- o << d;
-
- return print(o, t.tail );
-
-}
-
-template<class T>
-inline bool handle_width(std::ostream& o, const T& t) {
- std::streamsize width = o.width();
- if(width == 0) return false;
-
- std::ostringstream ss;
-
- ss.copyfmt(o);
- ss.tie(0);
- ss.width(0);
-
- ss << t;
- o << ss.str();
-
- return true;
-}
-
-
-#else
 
 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
 template<class CharType, class CharTrait, class T1>
@@ -315,47 +213,9 @@
     return true;
 }
 
-#endif // BOOST_NO_TEMPLATED_STREAMS
 
 } // namespace detail
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-
-inline std::ostream& operator<<(std::ostream& o, const null_type& t) {
- if (!o.good() ) return o;
- if (detail::handle_width(o, t)) return o;
-
- const char l =
- detail::format_info::get_manipulator(o, detail::format_info::open);
- const char r =
- detail::format_info::get_manipulator(o, detail::format_info::close);
-
- o << l;
- o << r;
-
- return o;
-}
-
-template<class T1, class T2>
-inline std::ostream& operator<<(std::ostream& o, const cons<T1, T2>& t) {
- if (!o.good() ) return o;
- if (detail::handle_width(o, t)) return o;
-
- const char l =
- detail::format_info::get_manipulator(o, detail::format_info::open);
- const char r =
- detail::format_info::get_manipulator(o, detail::format_info::close);
-
- o << l;
-
- detail::print(o, t);
-
- o << r;
-
- return o;
-}
-
-#else
 
 template<class CharType, class CharTrait>
 inline std::basic_ostream<CharType, CharTrait>&
@@ -395,7 +255,6 @@
 
   return o;
 }
-#endif // BOOST_NO_TEMPLATED_STREAMS
 
    
 // -------------------------------------------------------------
@@ -403,99 +262,6 @@
 
 namespace detail {
 
-#if defined (BOOST_NO_TEMPLATED_STREAMS)
-
-inline std::istream&
-extract_and_check_delimiter(
- std::istream& is, format_info::manipulator_type del)
-{
- const char d = format_info::get_manipulator(is, del);
-
-#if defined (BOOST_NO_STD_LOCALE)
- const bool is_delimiter = !isspace(d);
-#else
- const bool is_delimiter = (!std::isspace(d, is.getloc()) );
-#endif
-
- char c;
- if (is_delimiter) {
- is >> c;
- if (is.good() && c!=d) {
- is.setstate(std::ios::failbit);
- }
- } else {
- is >> std::ws;
- }
- return is;
-}
-
-
-// Note: The order of the read functions is critical to let a
-// (conforming?) compiler find and select the correct one.
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-template<class T1>
-inline std::istream &
-read (std::istream &is, cons<T1, null_type>& t1) {
-
- if (!is.good()) return is;
-
- return is >> t1.head ;
-}
-#else
-inline std::istream& read(std::istream& i, const null_type&) { return i; }
-#endif // !BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-template<class T1, class T2>
-inline std::istream&
-read(std::istream &is, cons<T1, T2>& t1) {
-
- if (!is.good()) return is;
-
- is >> t1.head;
-
-#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
- if (tuples::length<T2>::value == 0)
- return is;
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
- extract_and_check_delimiter(is, format_info::delimiter);
-
- return read(is, t1.tail);
-}
-
-} // end namespace detail
-
-inline std::istream&
-operator>>(std::istream &is, null_type&) {
-
- if (!is.good() ) return is;
-
- detail::extract_and_check_delimiter(is, detail::format_info::open);
- detail::extract_and_check_delimiter(is, detail::format_info::close);
-
- return is;
-}
-
-
-template<class T1, class T2>
-inline std::istream&
-operator>>(std::istream& is, cons<T1, T2>& t1) {
-
- if (!is.good() ) return is;
-
- detail::extract_and_check_delimiter(is, detail::format_info::open);
-
- detail::read(is, t1);
-
- detail::extract_and_check_delimiter(is, detail::format_info::close);
-
- return is;
-}
-
-
-
-#else
 
 template<class CharType, class CharTrait>
 inline std::basic_istream<CharType, CharTrait>&
@@ -590,7 +356,6 @@
   return is;
 }
 
-#endif // BOOST_NO_TEMPLATED_STREAMS
 
 } // end of namespace tuples
 } // end of namespace boost


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk