#include using namespace std; typedef const char * string; class Abstraction{ public: virtual void Operation()=0; }; class Bridge{ public: virtual void OperationImp()=0; }; class AbstractionX:public Abstraction{ Bridge *bridge; public: AbstractionX(Bridge& implementation){ bridge = &implementation; } void Operation(){ cout<<"AbstractionX"<<" <<< BRIDGE >>>> "; bridge->OperationImp(); } }; class AbstractionY : public Abstraction{ Bridge *bridge; public: AbstractionY(Bridge& implementation){ bridge = &implementation; } void Operation(){ cout<<"AbstractionY"<<" <<< BRIDGE >>>> "; bridge->OperationImp(); } }; class ImplementationA:public Bridge{ public: void OperationImp(){ cout<<"ImplementationA"<Operation(); delete ia; ia = new AbstractionY(B); ia->Operation(); delete ia; return 0; }