Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Base;
- class Derived1 : private Base;
- class Derived2 : protected Base;
- class Engine {
- public:
- Engine(int numCylinders);
- void start(); // Starts this Engine
- };
- class Car {
- public:
- Car() : e_(8) { } // Initializes this Car with 8 cylinders
- void start() { e_.start(); } // Start this Car by starting its Engine
- private:
- Engine e_; // Car has-a Engine
- };
- class Car : private Engine { // Car has-a Engine
- public:
- Car() : Engine(8) { } // Initializes this Car with 8 cylinders
- using Engine::start; // Start this Car by starting its Engine
- };
- struct noncopyable {
- private:
- noncopyable(noncopyable const&);
- noncopyable & operator=(noncopyable const&);
- };
- class my_noncopyable_type : noncopyable {
- // ...
- };
- template <typename T>
- class CBigArray : public IArray, private CLnkList {
- // ...
Add Comment
Please, Sign In to add comment