オブジェクトの名前を条件ステートメント内に配置するだけで、 がまたは値fstream
class
を返すことができる方法に興味があります。例えば...true
false
std::fstream fileStream;
fileStream.open("somefile.ext");
if (!fileStream) // How does this work?
std::cout << "File could not be opened...\n";
同様の方法で使用すると、自分のクラスが値を返すようにしたいので、これを尋ねます。