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
Post a Comment