0

I'm trying to do the following:

std::vector< std::fstream > filelist;

while( condition ) {
    fstream f( filename );
    // Do some stuff with f
    f.seekg( 0, std::ios_base::beg );
    filelist.push_back( std::move( f ) );
}

However, this is going ka-boom when I try to compile it. I know that streams are not supposed to be copy-able in C++11, but they should be move-able, right? I'm feeling like there's something I'm missing here.

Oh, and I am using g++ 4.8.1 with the --std=c++11 option

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Ken P
  • 552
  • 3
  • 11

1 Answers1

0

This particular feature is still not available in gcc 4.8. It should compile fine in clang and VS2012.

Jagannath
  • 3,995
  • 26
  • 30
  • OK, so g++-4.8.1 doesn't yet support the move constructors in streams. So, I guess I'll try using a std::vector> instead. – Ken P Jul 18 '13 at 15:05