Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 1st, 2012  |  syntax: D  |  size: 0.56 KB  |  views: 62  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. interface Foo
  2. {
  3.     void foo ();
  4. }
  5.  
  6. template FooImpl ()
  7. {
  8.     void foo () {}
  9. }
  10.  
  11. class FooClass // this needs a better name
  12. {
  13.     mixin FooImpl;
  14. }
  15.  
  16. interface Bar
  17. {
  18.     void bar ();
  19. }
  20.  
  21. template BarImpl ()
  22. {
  23.     void bar () {}
  24. }
  25.  
  26. class BarClass // this needs a better name
  27. {
  28.     mixin BarImpl;
  29. }
  30.  
  31. class FooBar : Foo, Bar
  32. {
  33.     mixin FooImpl;
  34.     mixin BarImpl;
  35.    
  36.     // since "foo" is overloaded we need to manually bring in "foo" in the
  37.     // overload set (or what it's called)
  38.     alias FooImpl.foo foo;
  39.    
  40.     void foo (int a) {}
  41. }
clone this paste RAW Paste Data