
cd /home/nbecker/shannon2/wrap/ g++34 -o Test Test.cc -g -I /usr/local/src/iostream/ In file included from /usr/local/src/iostream/boost/io/detail/streambufs/direct_streambuf.hpp:18, from /usr/local/src/iostream/boost/io/streambuf_facade.hpp:15, from /usr/local/src/iostream/boost/io/stream_facade.hpp:20, from Test.cc:1: /usr/local/src/iostream/boost/io/detail/streambufs/linked_streambuf.hpp:54: error: variable or field `close' declared void /usr/local/src/iostream/boost/io/detail/streambufs/linked_streambuf.hpp:54: error: `close' declared as a `virtual' field /usr/local/src/iostream/boost/io/detail/streambufs/linked_streambuf.hpp:54: error: expected `;' before '(' token In file included from /usr/local/src/iostream/boost/io/detail/adapters/filter_wrapper.hpp:16, from /usr/local/src/iostream/boost/io/detail/streambufs/indirect_streambuf.hpp:23, from /usr/local/src/iostream/boost/io/streambuf_facade.hpp:16, from /usr/local/src/iostream/boost/io/stream_facade.hpp:20, from Test.cc:1: /usr/local/src/iostream/boost/io/operations.hpp: In static member function `static void boost::io::detail::read_impl<boost::io::input>::putback(T&, typename boost::io::char_type<T>::type)': /usr/local/src/iostream/boost/io/operations.hpp:106: error: invalid application of `sizeof' to an incomplete type In file included from /usr/local/src/iostream/boost/io/detail/push.hpp:16, from /usr/local/src/iostream/boost/io/detail/streambufs/indirect_streambuf.hpp:28, from /usr/local/src/iostream/boost/io/streambuf_facade.hpp:16, from /usr/local/src/iostream/boost/io/stream_facade.hpp:20, from Test.cc:1: /usr/local/src/iostream/boost/io/detail/resolve.hpp: At global scope: /usr/local/src/iostream/boost/io/detail/resolve.hpp:38: error: non-template `result_type' used as template /usr/local/src/iostream/boost/io/detail/resolve.hpp:38: error: (use `U::template result_type' to indicate that it is a template) /usr/local/src/iostream/boost/io/detail/resolve.hpp:38: error: expected `{' before ';' token Adding #include <iostream> fixes this problem.

"Neal Becker" <ndbecker2@verizon.net> wrote in message news:chiqs5$3u1$1@sea.gmane.org... There are two patches that have already been posted which I would like you to try. I didn't patch the main distribution because I wanted to keep it frozen during the review. First, for boost/io/operations.hpp: --------- --- operations.hpp 1 Sep 2004 01:48:40 -0000 1.37 +++ operations.hpp 1 Sep 2004 01:48:49 -0000 @@ -19,6 +19,7 @@ #if !defined(BOOST_NO_STD_LOCALE) # include <locale> // neeed for boost::io::imbue. #endif +#include <boost/io/detail/assert_convertible.hpp> #include <boost/io/detail/dispatch.hpp> #include <boost/io/detail/iterator_traits.hpp> #include <boost/io/detail/ios_traits.hpp> @@ -103,7 +104,7 @@ template<typename T> static void putback(T&, BOOST_IO_CHAR_TYPE(T)) - { BOOST_STATIC_ASSERT(false); } + { BOOST_IO_ASSERT_CONVERTIBLE(BOOST_IO_CATEGORY(T), peekable_tag); } }; --------- next, for boost/io/detail/resolve.hpp --------- --- resolve.hpp 31 Aug 2004 18:02:51 -0000 1.4 +++ resolve.hpp 1 Sep 2004 01:13:32 -0000 @@ -35,7 +35,7 @@ BOOST_STATIC_ASSERT(!is_const<T>::value); #ifndef BOOST_IO_NO_FULL_SMART_ADAPTER_SUPPORT template<typename U> - struct get_result_type : U::result_type<Mode, Ch> { }; + struct get_result_type : U::template result_type<Mode, Ch> { }; #else template<typename U> struct get_result_type { ---------
Adding #include <iostream> fixes this problem.
What file did you add the include to? I'm trying to get by with <iosfwd> and <ios> wherever possible. Thanks for the report. Let me know if it works with the above patches. Jonathan

Jonathan Turkanis wrote:
I added it to my Test program. I don't know what the problem is at this point, but here is the test case. If you leave #include <iostream> commented, compile with g++34 fails, but uncomment and it's OK. #include <iostream> #include <boost/io/stream_facade.hpp> #include <vector> #include <string> namespace io = boost::io; #include <vector> #include <boost/io/concepts.hpp> // sink struct vector_sink : public io::sink { vector_sink(std::vector<char>& _vec) : vec(_vec) { } void write(const char* s, std::streamsize n) { vec.insert(vec.end(), s, s + n); } std::vector<char>& vec; }; std::vector<char> F () { std::vector<char> v; vector_sink s (v); io::stream_facade<vector_sink> out(s); out << "hello"; out.close(); return v; } int main() { F(); }

"Neal Becker" <ndbecker2@verizon.net> wrote in message news:chj424$iu0$1@sea.gmane.org...
<snip> Okay, I think I've found the problem. Somehow, I didn't include <istream> and <ostream> in <boost/io/stream_facade.hpp> (I probably erased them at some point by mistake.) Also, I stuck includes for <iostream> all over the place for debugging, and forgot to remove them. Maybe this is why the problem is just showing up now. Try adding the includes to stream_facade, and removing the iostream include in your sample. Best Regards, Jonathan
participants (2)
-
Jonathan Turkanis
-
Neal Becker