To my understanding, certain classes, like ifstream, have a conversion to a primitive data type, like bool. In other words, you can do this:
if((fin >> x) && done == false)
//...
Now, does this simply work because ifstream has the && operator overloaded, or can objects of that class just always be converted to bool? So would this:
if((fin >> x))
//...
work? If so, how can you set a class to convert to bool, or int, or any other data type?