What does this bool operator actually do in C++? And how does this weird thing can be useful? -


when read c++ book encountered strange operator !():

class myclass {       public: bool operator !() const {}//what it??   }; 

can explain me purpose please.

that ill-formed program, taken operator! declared return bool not return anything. being fixed, negation operator , can called on object prefixing !.

myclass c; !c;         // c.operator!() 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -