This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

trouble using ifstream as a class member


I am forced to compile against an old version of the library, 2.9.0. This
code works fine under the current library/compiler.

Given the following:

#include <fstream>

class BStream {
public:
...
   void Open(const std::string& filename);
   void ReadHeader();

private:
   std::ifstream tis;
};

After the file has been opened succesfully a call to read() in
ReadHeader()
fails to read any characters and the eof bit is set. The same sequence of
commands works if std::ifstream tis is not wrapped as a class member.

Why is this?
How can I make it work?

Thank you,

W
-- 

   Healthy people don't lie.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]