Boost C++ Libraries: Ticket #12129: C++11 / C++14 compability in boost/iostreams https://svn.boost.org/trac10/ticket/12129 <p> Hi, </p> <p> with this code </p> <pre class="wiki">#include &lt;fstream&gt; #include &lt;iostream&gt; #include &lt;boost/iostreams/filtering_stream.hpp&gt; #include &lt;boost/iostreams/copy.hpp&gt; #include &lt;boost/iostreams/filter/zlib.hpp&gt; int main() { using namespace std; ifstream file("hello.z", ios_base::in | ios_base::binary); boost::iostreams::filtering_stream&lt;boost::iostreams::input&gt; in; in.push(boost::iostreams::zlib_decompressor()); in.push(file); boost::iostreams::copy(in, cout); } </pre><p> The current trunk compiles. However, if the -std=c++11 or -std=c++14 flags are specified with gcc (tested versions 4.9.2 and 5.3.0) the following error is displayd: </p> <pre class="wiki">In file included from /usr/include/boost/iostreams/traits.hpp:31:0, from /usr/include/boost/iostreams/pipeline.hpp:18, from /usr/include/boost/iostreams/detail/push.hpp:22, from /usr/include/boost/iostreams/filtering_stream.hpp:19, from test.cpp:3: /usr/include/boost/iostreams/detail/wrap_unwrap.hpp: In instantiation of ‘T boost::iostreams::detail::wrap(const T&amp;, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’: /usr/include/boost/iostreams/stream_buffer.hpp:93:5: required from ‘boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::stream_buffer(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/chain.hpp:252:60: required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Self = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/chain.hpp:212:5: required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push(const T&amp;, int, int, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Self = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’ /usr/include/boost/iostreams/chain.hpp:491:7: required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;]’ /usr/include/boost/iostreams/chain.hpp:479:5: required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push(const T&amp;, int, int, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’ test.cpp:13:50: required from here /usr/include/boost/iostreams/detail/wrap_unwrap.hpp:53:14: error: use of deleted function ‘boost::iostreams::basic_zlib_decompressor&lt;&gt;::basic_zlib_decompressor(const boost::iostreams::basic_zlib_decompressor&lt;&gt;&amp;)’ { return t; } ^ In file included from test.cpp:5:0: /usr/include/boost/iostreams/filter/zlib.hpp:280:8: note: ‘boost::iostreams::basic_zlib_decompressor&lt;&gt;::basic_zlib_decompressor(const boost::iostreams::basic_zlib_decompressor&lt;&gt;&amp;)’ is implicitly deleted because the default definition would be ill-formed: struct basic_zlib_decompressor ^ /usr/include/boost/iostreams/filter/zlib.hpp:280:8: error: use of deleted function ‘boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::symmetric_filter(const boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;&amp;)’ In file included from /usr/include/boost/iostreams/filter/zlib.hpp:31:0, from test.cpp:5: /usr/include/boost/iostreams/filter/symmetric.hpp:72:7: note: ‘boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::symmetric_filter(const boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;&amp;)’ is implicitly deleted because the default definition would be ill-formed: class symmetric_filter { ^ /usr/include/boost/iostreams/filter/symmetric.hpp:72:7: error: use of deleted function ‘boost::shared_ptr&lt;boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::impl&gt;::shared_ptr(const boost::shared_ptr&lt;boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::impl&gt;&amp;)’ In file included from /usr/include/boost/shared_ptr.hpp:17:0, from /usr/include/boost/iostreams/chain.hpp:37, from /usr/include/boost/iostreams/filtering_streambuf.hpp:17, from /usr/include/boost/iostreams/filtering_stream.hpp:22, from test.cpp:3: /usr/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: ‘boost::shared_ptr&lt;boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::impl&gt;::shared_ptr(const boost::shared_ptr&lt;boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::impl&gt;&amp;)’ is implicitly declared as deleted because ‘boost::shared_ptr&lt;boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::zlib_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::impl&gt;’ declares a move constructor or move assignment operator template&lt;class T&gt; class shared_ptr ^ In file included from /usr/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:23:0, from /usr/include/boost/iostreams/stream_buffer.hpp:22, from /usr/include/boost/iostreams/chain.hpp:35, from /usr/include/boost/iostreams/filtering_streambuf.hpp:17, from /usr/include/boost/iostreams/filtering_stream.hpp:22, from test.cpp:3: /usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp: In instantiation of ‘boost::iostreams::detail::concept_adapter&lt;T&gt;::concept_adapter(const T&amp;) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;]’: /usr/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:186:5: required from ‘void boost::iostreams::detail::indirect_streambuf&lt;T, Tr, Alloc, Mode&gt;::open(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/stream_buffer.hpp:103:28: required from ‘void boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::open_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/stream_buffer.hpp:93:5: required from ‘boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::stream_buffer(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/chain.hpp:252:60: required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Self = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/chain.hpp:212:5: required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push(const T&amp;, int, int, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Self = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’ /usr/include/boost/iostreams/chain.hpp:491:7: required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;]’ /usr/include/boost/iostreams/chain.hpp:479:5: required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push(const T&amp;, int, int, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’ test.cpp:13:50: required from here /usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp:64:48: error: use of deleted function ‘boost::iostreams::basic_zlib_decompressor&lt;&gt;::basic_zlib_decompressor(const boost::iostreams::basic_zlib_decompressor&lt;&gt;&amp;)’ explicit concept_adapter(const T&amp; t) : t_(t) ^ In file included from /usr/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp:26:0, from /usr/include/boost/iostreams/stream_buffer.hpp:21, from /usr/include/boost/iostreams/chain.hpp:35, from /usr/include/boost/iostreams/filtering_streambuf.hpp:17, from /usr/include/boost/iostreams/filtering_stream.hpp:22, from test.cpp:3: /usr/include/boost/iostreams/detail/optional.hpp: In instantiation of ‘void boost::iostreams::detail::optional&lt;T&gt;::reset(const T&amp;) [with T = boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_zlib_decompressor&lt;&gt; &gt;]’: /usr/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:186:5: required from ‘void boost::iostreams::detail::indirect_streambuf&lt;T, Tr, Alloc, Mode&gt;::open(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/stream_buffer.hpp:103:28: required from ‘void boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::open_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/stream_buffer.hpp:93:5: required from ‘boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::stream_buffer(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/chain.hpp:252:60: required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Self = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input]’ /usr/include/boost/iostreams/chain.hpp:212:5: required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push(const T&amp;, int, int, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Self = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’ /usr/include/boost/iostreams/chain.hpp:491:7: required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push_impl(const T&amp;, int, int) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;]’ /usr/include/boost/iostreams/chain.hpp:479:5: required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push(const T&amp;, int, int, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_zlib_decompressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’ test.cpp:13:50: required from here /usr/include/boost/iostreams/detail/optional.hpp:100:9: error: use of deleted function ‘boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_zlib_decompressor&lt;&gt; &gt;::concept_adapter(const boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_zlib_decompressor&lt;&gt; &gt;&amp;)’ new (address()) T(t); ^ In file included from /usr/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:23:0, from /usr/include/boost/iostreams/stream_buffer.hpp:22, from /usr/include/boost/iostreams/chain.hpp:35, from /usr/include/boost/iostreams/filtering_streambuf.hpp:17, from /usr/include/boost/iostreams/filtering_stream.hpp:22, from test.cpp:3: /usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp:35:7: note: ‘boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_zlib_decompressor&lt;&gt; &gt;::concept_adapter(const boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_zlib_decompressor&lt;&gt; &gt;&amp;)’ is implicitly deleted because the default definition would be ill-formed: class concept_adapter { ^ /usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp:35:7: error: use of deleted function ‘boost::iostreams::basic_zlib_decompressor&lt;&gt;::basic_zlib_decompressor(const boost::iostreams::basic_zlib_decompressor&lt;&gt;&amp;)’ </pre><p> Almost the same error shows up when the gzip_decompressor is used to replace the zlib_decompressor. </p> <p> This bug is also present in the 1.60.0 download. </p> <p> Thanks for looking into this, Christian </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12129 Trac 1.4.3 Christian Meesters <meesters@…> Fri, 22 Apr 2016 13:12:02 GMT <link>https://svn.boost.org/trac10/ticket/12129#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12129#comment:1</guid> <description> <p> Is the description not sufficiently clear or should I provide more details? If so, which? </p> <p> Best, Christian Meesters </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 16 May 2016 17:56:45 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/12129#comment:2 https://svn.boost.org/trac10/ticket/12129#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Jonathan Turkanis</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iostreams</span> </li> </ul> Ticket Christian Meesters <meesters@…> Fri, 03 Jun 2016 08:24:43 GMT <link>https://svn.boost.org/trac10/ticket/12129#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12129#comment:3</guid> <description> <p> Thanks for looking into this. </p> <p> Christian </p> </description> <category>Ticket</category> </item> </channel> </rss>