Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C++ / operator overload

Name: Anonymous 2012-05-16 15:57

hello,

bool operator ! () { return head == NULL; }

how do I use the logical not operator now?

I tried: if( ! ) head = curr; ... but I get compiler errors

Name: Anonymous 2012-05-16 16:11

I'm fairly sure you can't overload !. What you could do is overload operator bool. What you should do is write in haskell

Name: Anonymous 2012-05-16 16:18

http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fcplr318.htm right under the given example there is a list of operators which can be overloaded, it also contains  "  !   "

Name: Anonymous 2012-05-16 16:22

I tried: if( ! ) head = curr; ... but I get compiler errors

oh god my balls

Name: bampu pantsu 2012-05-29 5:00

bampu pantsu

Don't change these.
Name: Email:
Entire Thread Thread List