Skip to content

D Tip: Policy-based Design

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: , , , , ,

Post a Comment

Your email is never published nor shared. Required fields are marked *