Moving a class derived from istream
问题 I'm creating a C++ istream with a custom streambuf . Trying to move this fails because the istream move constructor is protected. To get round this I derived a class from istream : struct VectorCharBuf : public streambuf { VectorCharBuf(vector<char>& v) { setg(v.data(), v.data(), v.data() + v.size()); } }; struct IVectorCharStream : public istream { IVectorCharStream(VectorCharBuf* contents_buf) : istream(contents_buf) {} }; The default move constructor for this class is not generated because