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.
This is a discussion on How does a class name return an expression within the C++ Programming forums, part of the General Programming Boards category; How can the name of an object of a class be used as an expression, like what would I need ...
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?
I used to be an adventurer like you... then I took an arrow to the knee.
Thanks for the quick response, that's what i was looking for.