How can the name of an object of a class be used as an expression, like what would I need to do in the class definition? I'm thinking something along the lines of how std::cin can be used to check if the stream is in a good state.
Thanks.
How can the name of an object of a class be used as an expression, like what would I need to do in the class definition? I'm thinking something along the lines of how std::cin can be used to check if the stream is in a good state.
Thanks.
Last edited by Kirdra; 10-07-2010 at 10:32 AM.
You mean like the safe bool idiom?
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
Thanks for the quick response, that's what i was looking for.