Hoe do I check that something's null, like in:
How do I check to see if "prev" was ever set?Code:class Test { private: std::string name; Test prev; Test(Test previous, std::string n) : prev( previous ), name( n ) {} Test(std::string n) : name( n ) {} const char* test() { //I want to do smth similar to this type of code: if ( prev != null ) return ...elided...; ..rest elided... } }



LinkBack URL
About LinkBacks




I want to know how I can check if that variable was ever set. How do I do that? (Because if it wasn't set and I try to call a member on it, I'll get a runtime error)
CornedBee