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

overloading operators

Name: Anonymous 2011-01-31 15:59

why would you overload already existing operators in Sepples instead of inventing your own symbol or keyword to avoid confusion with non-overloaded standard operators?

Name: Anonymous 2011-02-01 2:22

Generic code, bitches.

template<typename MyAnus>
void hax(Anus& anus)
{
  anus ^= 2;
  anus ^= anus;
  anus ^= 21;
}

works for everything that defines ^= operator ([spoiler]NO EXCEPTIONS). I can use it like

  MyAnus myAnus;
  OpAnus opAnus;
  hax(myAnus);
  hax(opAnus);

If i decided to implement custom operators like ^^= and =^_^= then the code above wouldn't compile.

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