title: c++ rvalue of moveable type in constructor
body: <p>I am using C++11 and trying to construct a class that owns a movable type like this:</p>
  
  <pre><code>class foo {
      std::istream input;
  
  public:
      foo(std::istream &amp;&amp; in): input(in) { }
  };
  </code></pre>
  
  <p>And then instantiate the object:</p>
  
  <pre><code>foo var1(std::ifstream("/tmp/something"));
  </code></pre>
  
  <p>But the compiler always complains that I am calling a deleted constructor. Is this even possible?</p>
  
  <pre><code>clang++ -stdlib=libc++ -std=c++0x foo.cpp 
  foo.cpp:7:30: error: call to deleted constructor of 'std::istream' (aka 'basic_istream&lt;char&gt;')
      foo(std::istream &amp;&amp; in): input(in) { }
                               ^     ~~
  /usr/bin/../lib/c++/v1/istream:1740:23: note: function has been explicitly marked deleted here
  extern template class basic_istream&lt;char&gt;;
                        ^
  1 error generated.
  </code></pre>