# include  <queue> # include  <iostream> # include  <algorithm> # include  <iterator> ; 
class Target
{ 
  public: 
    virtual ~ Target ( )  { } 
    virtual void  method ( )  =  0 ; 
} ; 
class Adaptee
{ 
  public: 
    void  spec_method ( ) 
    { 
        std:: cout <<  "spec_method run"  <<  std:: endl; 
    } 
} ; 
class Adapter :  public Target,  public Adaptee
{ 
  public: 
    void  method ( )  override
    { 
        std:: cout <<  "call from Adapter: "  <<  std:: endl; 
        spec_method ( ) ; 
    } 
} ; 
int  main ( int  argc,  char * *  argv) 
{ 
    Adaptee adaptee; 
    adaptee. spec_method ( ) ; 
    
    std:: cout <<  std:: endl; 
    Adapter adapter; 
    adapter. method ( ) ; 
    return  0 ; 
} 
# include  <queue> # include  <iostream> # include  <algorithm> # include  <iterator> ; 
class Target
{ 
  public: 
    virtual ~ Target ( )  { } 
    virtual void  method ( )  =  0 ; 
} ; 
class Adaptee
{ 
  public: 
    void  spec_method ( ) 
    { 
        std:: cout <<  "spec_method run"  <<  std:: endl; 
    } 
} ; 
class Adapter :  public Target
{ 
  public: 
    Adapter ( Adaptee*  adaptee) 
        :  adaptee_{ adaptee} 
    { 
    } 
    void  method ( )  override
    { 
        std:: cout <<  "call from Adapter: "  <<  std:: endl; 
        adaptee_-> spec_method ( ) ; 
    } 
  private: 
    Adaptee*  adaptee_; 
} ; 
int  main ( int  argc,  char * *  argv) 
{ 
    Adaptee adaptee; 
    adaptee. spec_method ( ) ; 
    std:: cout <<  std:: endl; 
    Adapter adapter ( & adaptee) ; 
    adapter. method ( ) ; 
    return  0 ; 
}