On Wednesday, 10 June 2015 at 00:26:23 UTC, ZombineDev wrote:

// Templatize a module by memory management strategy (and more).
// Like specifying versions on the command-line, but
// as powerful as templates:

enum desired_mms = MMStrategy.refCounting;
import image_processing!desired_mms : Image;
// Image is a refcounted or GC class, depending on
// the module template parameter

[1]: http://beta.forum.dlang.org/thread/m0bdgg$1t7j$1...@digitalmars.com

Why not something like

alias HashMap (T) = std.container.HashMap!(T, MMStrategy.refCounting)

which is available now, just depends on how the template arts for a given container are set up.

Reply via email to