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

Kill C++

Name: Anonymous 2010-09-07 11:16

C++ is C done wrong. We must purge C++ from this world.

Who is with me?

Name: Anonymous 2010-09-09 20:28

C++ does suck, and the fact that I have no choice but to use it sucks even more.  I ran into this today:


class shit
{
   class inner_shit
   {
      // A fucntion pointer
      typedef void (inner_shit::*func)(int a);

      func f;
   }

   std::vector<inner_shit *> vec;

   void shit_func()
   {
      // I'd like to actually call the fucking "f" function member of an "inner_shit" here...
   }
};


Struggled with it for thirty minutes before I figured out that the correct syntax is:


      (this->*vec[5]->f)(5);


If you omit anything -- the bullshit this->* or the parentheses around the whole first part -- compiler error.

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