How to do Generic Programming in D?

Nick nick at example.com
Tue Feb 22 11:04:50 PST 2011


Coming from Andrei's work in C++ "Modern C++ Programming" I wonder how 
to implement many of those patterns in D?

In C++ I would work with type lists and use lots of multiple inheritance 
and templates to get the magic I need.

D lacks MI, classes and delegates seem heavy (allocated on heap, with 
one extra pointer and new for each delegate) and has instead template 
mixins which do not create types and string mixing which create... anything.

So I am a bit lost.

I guess I am looking for some code&examples to read to "get" GP in D. A 
bit like "Modern C++ Programming".

Of course, the basic question being: is D2 sufficient to support 
everything that is possible in C++?

Thanks!


More information about the Digitalmars-d mailing list