2

I know how i can realize a implementation of a class with the policy based design pattern from c++ with Interfaces. I don't know how to do the same with class mixin's.

This would be useful if you want to squeze the last performance out of your code because it is easy inlinable and the "border" of the virtual calls for the interfaces is not there.

Quonux
  • 2,975
  • 1
  • 24
  • 32

2 Answers2

3

I wrote a blog post which might be relevant: Low-overhead components. It discusses using mixins as building blocks for creating flexible, configurable and high-performance components, and the associated caveats.

Vladimir Panteleev
  • 24,651
  • 6
  • 70
  • 114
1

You mean C++-style policy based design pattern (as explained in Modern C++ Design)? In D you can use static if instead which is simpler.

ponce
  • 919
  • 5
  • 15