hi
can you overload class operators so that you can do this?
if(Smartpointer)
{}
and this:
if(Smartpointer == x)
{}
proplem i'm running to is that if you overload type conversion to bool then == operator doesn't get called.
thank you
Yes, you can. The first operator is
explicit Smartpointer::operator bool() const;
The second operator is
bool operator ==( const Smartpointer &, const Smartpointer & );
Last edited on
The second way is to write conversion operator to const void * without using explicit.
that did the job! :)
thanks