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

Y U SO PRIVATE?

Name: Anonymous 2011-11-20 11:40

#include <iostream>
 
class Monkey {
        public:
                void print() { std::cout << "Private inheritance is shit" << std::endl; }
};
 
class CppMonkey : private Monkey {
};
 
int main() {
        CppMonkey *you = new CppMonkey;
        reinterpret_cast<Monkey*>(you)->print();
        return 0;
}

Name: Anonymous 2011-11-20 11:52

Inheritance is one of the stupidest things OOP brought into mainstream programming. I have no idea what that code does and I don't intend to harm my mind by trying to understand what is a reinterpret_cast.

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