// Copyright (c) 2008 Alexander Sandler // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #include using namespace std; class A { public: A() { a_member = 0x10101010; } virtual void set_a( int new_a ) { a_member = new_a; } protected: int a_member; }; class B { public: B() { b_member = 0x20202020; } virtual void set_b( int new_b ) { b_member = new_b; } protected: int b_member; }; class C : public A { public: C() : A() { c_member = 0x30303030; } virtual void set_c( int new_c ) { c_member = new_c; } protected: int c_member; }; class D : public C { public: D() : C() { d_member = 0x40404040; } virtual void set_d( int new_d ) { d_member = new_d; } protected: int d_member; }; class E : public B { public: E() : B() { e_member = 0x50505050; } virtual void set_e( int new_e ) { e_member = new_e; } protected: int e_member; }; class F : public C { public: F() : C() { f_member = 0x60606060; } virtual void set_f( int new_f ) { f_member = new_f; } protected: int f_member; }; class G : public D { public: G() : D() { g_member = 0x70707070; } virtual void set_g( int new_g ) { g_member = new_g; } protected: int g_member; }; class H : public E { public: H() : E() { h_member = 0x80808080; } virtual void set_h( int new_h ) { h_member = new_h; } protected: int h_member; }; class X : public F, public G, public H { public: X() : F(), G(), H() { x_member = 0x90909090; } virtual void set_x( int new_x ) { x_member = new_x; } protected: int x_member; }; int main() { X x; x.set_a( 20 ); return 0; }