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
  • 43,322
  • 6
  • 62
  • 109
Ken P
  • 524
  • 3
  • 9

1 Answers1

0

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

Jagannath
  • 3,968
  • 23
  • 28
  • 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