いくつかの前方宣言を含むヘッダー ファイルがありますが、ヘッダー ファイルを実装ファイルにインクルードすると、前の前方宣言のインクルードの後にインクルードされ、このようなエラーが発生します。
error: using typedef-name ‘std::ifstream’ after ‘class’
/usr/include/c++/4.2.1/iosfwd:145: error: ‘std::ifstream’ has a previous declaration.
class ifstream;
class A
{
ifstream *inStream;
}
// End of A.h
#include <ifstream>
using std::ifstream;
#include "A.h"
// etc
これを回避するための標準は何ですか?
前もって感謝します。