ICookie { static void get(); }
                  
                  
                  
                  
                  
                  class Coffee : ICoffee
                  
                  
                  {
                  
                  
                      public static void get() { "Coffee Ready".writeln; }
                  
                  
                  }
                  
                  
                  
                  
                  
                  class Cookie : ICookie
                  
                  
                  {
                  
                  
                      public static void get() { "Cookie Ready".writeln; }
                  
                  
                  }
                  
                  
                  
                  
                  
                  class Combo
                  
                  
                  {
                  
                  
                      alias coffee = Coffee.get;
                  
                  
                      alias cookie = Cookie.get;
                  
                  
                      
                  
                  
                      void get() { "coffee & cookie Ready".writeln; }
                  
                  
                      
                  
                  
                      alias both = get;
                  
                  
                  }
                  
                  
                  
                  
                  
                  void main()
                  
                  
                  {
                  
                  
                      auto combo = new Combo;
                  
                  
                      combo.coffee;
                  
                  
                      combo.cookie;
                  
                  
                      combo.both;
                  
                  
                  }
                  
                  
                
зачем мучать
Обсуждают сегодня