Advertisement
Guest User

Untitled

a guest
Apr 1st, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.56 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement