Policies are a powerful technique to use for some class designs. It’s a well known solution in C++, but someone coming to D may run into wrinkles using certain variations of the technique. I recently posted two entries (1, 2) on my D blog showing two ways to implement policies in D. Templates in D are similar to C++ templates, but there are enough differences that some practice may be required to get a feel for them. For more info on D templates, read the Templates page of the D Programming Language docs and Walter Bright’s article, Templates Revisited.
Technorati Tags: D Programming Language, policy-based design, templates, game development, game programming, Walter Bright
Post a Comment