$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: technews_at_[hidden]
Date: 2008-02-22 17:40:10
Author: turkanis
Date: 2008-02-22 17:40:10 EST (Fri, 22 Feb 2008)
New Revision: 43376
URL: http://svn.boost.org/trac/boost/changeset/43376
Log:
fixed close() for filtering streams and stream buffers
Text files modified: 
   branches/iostreams_dev/boost/iostreams/close.hpp |    10 ++++------                              
   1 files changed, 4 insertions(+), 6 deletions(-)
Modified: branches/iostreams_dev/boost/iostreams/close.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/close.hpp	(original)
+++ branches/iostreams_dev/boost/iostreams/close.hpp	2008-02-22 17:40:10 EST (Fri, 22 Feb 2008)
@@ -202,14 +202,12 @@
 template<>
 struct close_impl<close_filtering_stream> {
     template<typename T>
-    static void close(T& t)
-    {
-        t.pop();
-    }
-    template<typename T>
     static void close(T& t, BOOST_IOS::openmode which)
     {
-        if (which == BOOST_IOS::out)
+        typedef typename category_of<T>::type category;
+        const bool in =  is_convertible<category, input>::value &&
+                        !is_convertible<category, output>::value;
+        if (in == (which == BOOST_IOS::in))
             t.pop();
     }
 };