title: boost::iostreams::bzip2_compressor fails only with c++0x
body: <p>The bare-bones minimal example:</p>
  
  <pre><code>#include &lt;boost/iostreams/filtering_stream.hpp&gt;
  #include &lt;boost/iostreams/filter/bzip2.hpp&gt;  
  int main() {
    boost::iostreams::filtering_istream in;
    in.push(boost::iostreams::bzip2_compressor());
    return 0;
  }
  </code></pre>
  
  <p>Compiles fine on my machine with:</p>
  
  <pre><code>g++ -lboost_iostreams  simple.cpp 
  </code></pre>
  
  <p>But fails when c++0x is included in either instance of :</p>
  
  <pre><code>g++ -lboost_iostreams  simple.cpp -std=c++0x
  g++ -lboost_iostreams  simple.cpp -std=gnu++0x
  </code></pre>
  
  <p>The insanely long error message is below. What in the code is causing <code>c++0x</code> to fail? How can this be fixed? I've run this three machines, each with different configurations - it fails on two, but runs correctly on a stock Ubuntu install. </p>
  
  <pre><code>In file included from /usr/local/include/boost/iostreams/traits.hpp:31:0,
                   from /usr/local/include/boost/iostreams/pipeline.hpp:18,
                   from /usr/local/include/boost/iostreams/detail/push.hpp:22,
                   from /usr/local/include/boost/iostreams/filtering_stream.hpp:19,
                   from simple.cpp:1:
  /usr/local/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_bzip2_compressor&lt;&gt;; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’:
  /usr/local/include/boost/iostreams/stream_buffer.hpp:94:5:   required from ‘boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::stream_buffer(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:257:60:   required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&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; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:216:1:   required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push(const T&amp;, std::streamsize, std::streamsize, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_bzip2_compressor&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; std::streamsize = long int; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’
  /usr/local/include/boost/iostreams/chain.hpp:496:7:   required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:484:1:   required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push(const T&amp;, std::streamsize, std::streamsize, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; std::streamsize = long int; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’
  simple.cpp:6:47:   required from here
  /usr/local/include/boost/iostreams/detail/wrap_unwrap.hpp:53:14: error: use of deleted function ‘boost::iostreams::basic_bzip2_compressor&lt;&gt;::basic_bzip2_compressor(const boost::iostreams::basic_bzip2_compressor&lt;&gt;&amp;)’
  In file included from simple.cpp:2:0:
  /usr/local/include/boost/iostreams/filter/bzip2.hpp:239:8: note: ‘boost::iostreams::basic_bzip2_compressor&lt;&gt;::basic_bzip2_compressor(const boost::iostreams::basic_bzip2_compressor&lt;&gt;&amp;)’ is implicitly deleted because the default definition would be ill-formed:
  /usr/local/include/boost/iostreams/filter/bzip2.hpp:239:8: error: use of deleted function ‘boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::bzip2_compressor_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::bzip2_compressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;&amp;)’
  In file included from /usr/local/include/boost/iostreams/filter/bzip2.hpp:29:0,
                   from simple.cpp:2:
  /usr/local/include/boost/iostreams/filter/symmetric.hpp:72:7: note: ‘boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::bzip2_compressor_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::bzip2_compressor_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:
  /usr/local/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::bzip2_compressor_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::bzip2_compressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::impl&gt;&amp;)’
  In file included from /usr/local/include/boost/shared_ptr.hpp:17:0,
                   from /usr/local/include/boost/iostreams/chain.hpp:37,
                   from /usr/local/include/boost/iostreams/filtering_streambuf.hpp:17,
                   from /usr/local/include/boost/iostreams/filtering_stream.hpp:22,
                   from simple.cpp:1:
  /usr/local/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: ‘boost::shared_ptr&lt;boost::iostreams::symmetric_filter&lt;boost::iostreams::detail::bzip2_compressor_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::bzip2_compressor_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::bzip2_compressor_impl&lt;std::allocator&lt;char&gt; &gt;, std::allocator&lt;char&gt; &gt;::impl&gt;’ declares a move constructor or move assignment operator
  In file included from /usr/local/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:23:0,
                   from /usr/local/include/boost/iostreams/stream_buffer.hpp:22,
                   from /usr/local/include/boost/iostreams/chain.hpp:35,
                   from /usr/local/include/boost/iostreams/filtering_streambuf.hpp:17,
                   from /usr/local/include/boost/iostreams/filtering_stream.hpp:22,
                   from simple.cpp:1:
  /usr/local/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_bzip2_compressor&lt;&gt;]’:
  /usr/local/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:187:5:   required from ‘void boost::iostreams::detail::indirect_streambuf&lt;T, Tr, Alloc, Mode&gt;::open(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/stream_buffer.hpp:106:13:   required from ‘void boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::open_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/stream_buffer.hpp:94:5:   required from ‘boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::stream_buffer(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:257:60:   required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&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; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:216:1:   required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push(const T&amp;, std::streamsize, std::streamsize, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_bzip2_compressor&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; std::streamsize = long int; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’
  /usr/local/include/boost/iostreams/chain.hpp:496:7:   required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:484:1:   required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push(const T&amp;, std::streamsize, std::streamsize, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; std::streamsize = long int; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’
  simple.cpp:6:47:   required from here
  /usr/local/include/boost/iostreams/detail/adapter/concept_adapter.hpp:67:48: error: use of deleted function ‘boost::iostreams::basic_bzip2_compressor&lt;&gt;::basic_bzip2_compressor(const boost::iostreams::basic_bzip2_compressor&lt;&gt;&amp;)’
  In file included from /usr/local/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp:26:0,
                   from /usr/local/include/boost/iostreams/stream_buffer.hpp:21,
                   from /usr/local/include/boost/iostreams/chain.hpp:35,
                   from /usr/local/include/boost/iostreams/filtering_streambuf.hpp:17,
                   from /usr/local/include/boost/iostreams/filtering_stream.hpp:22,
                   from simple.cpp:1:
  /usr/local/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_bzip2_compressor&lt;&gt; &gt;]’:
  /usr/local/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:187:5:   required from ‘void boost::iostreams::detail::indirect_streambuf&lt;T, Tr, Alloc, Mode&gt;::open(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/stream_buffer.hpp:106:13:   required from ‘void boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::open_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/stream_buffer.hpp:94:5:   required from ‘boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::stream_buffer(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:257:60:   required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&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; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:216:1:   required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push(const T&amp;, std::streamsize, std::streamsize, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_bzip2_compressor&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; std::streamsize = long int; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’
  /usr/local/include/boost/iostreams/chain.hpp:496:7:   required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:484:1:   required from ‘void boost::iostreams::detail::chain_client&lt;Chain&gt;::push(const T&amp;, std::streamsize, std::streamsize, typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type*) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Chain = boost::iostreams::chain&lt;boost::iostreams::input, char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;; std::streamsize = long int; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’
  simple.cpp:6:47:   required from here
  /usr/local/include/boost/iostreams/detail/optional.hpp:100:9: error: use of deleted function ‘boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_bzip2_compressor&lt;&gt; &gt;::concept_adapter(const boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_bzip2_compressor&lt;&gt; &gt;&amp;)’
  In file included from /usr/local/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:23:0,
                   from /usr/local/include/boost/iostreams/stream_buffer.hpp:22,
                   from /usr/local/include/boost/iostreams/chain.hpp:35,
                   from /usr/local/include/boost/iostreams/filtering_streambuf.hpp:17,
                   from /usr/local/include/boost/iostreams/filtering_stream.hpp:22,
                   from simple.cpp:1:
  /usr/local/include/boost/iostreams/detail/adapter/concept_adapter.hpp:38:7: note: ‘boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_bzip2_compressor&lt;&gt; &gt;::concept_adapter(const boost::iostreams::detail::concept_adapter&lt;boost::iostreams::basic_bzip2_compressor&lt;&gt; &gt;&amp;)’ is implicitly deleted because the default definition would be ill-formed:
  /usr/local/include/boost/iostreams/detail/adapter/concept_adapter.hpp:38:7: error: use of deleted function ‘boost::iostreams::basic_bzip2_compressor&lt;&gt;::basic_bzip2_compressor(const boost::iostreams::basic_bzip2_compressor&lt;&gt;&amp;)’
  
  
  
  In file included from /usr/local/include/boost/iostreams/traits.hpp:31:0,
                   from /usr/local/include/boost/iostreams/pipeline.hpp:18,
                   from /usr/local/include/boost/iostreams/detail/push.hpp:22,
                   from /usr/local/include/boost/iostreams/filtering_stream.hpp:19,
                   from simple.cpp:1:
  /usr/local/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_bzip2_compressor&lt;&gt;; typename boost::disable_if&lt;boost::iostreams::is_std_io&lt;T&gt; &gt;::type = void]’:
  /usr/local/include/boost/iostreams/stream_buffer.hpp:94:5:   required from ‘boost::iostreams::stream_buffer&lt;T, Tr, Alloc, Mode&gt;::stream_buffer(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&lt;&gt;; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; Mode = boost::iostreams::input; std::streamsize = long int]’
  /usr/local/include/boost/iostreams/chain.hpp:257:60:   required from ‘void boost::iostreams::detail::chain_base&lt;Self, Ch, Tr, Alloc, Mode&gt;::push_impl(const T&amp;, std::streamsize, std::streamsize) [with T = boost::iostreams::basic_bzip2_compressor&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; std::streamsize = long int]’
  </code></pre>