Template Constructors
Part of TemplatesCategory
Description
Using a template to create class constructors
Example
class Foo(T) { private static T _bar; static this() { // initialize _bar } static ~this() { // finalize _bar } static void baz() { // use _bar } } int main() { Foo!(int).baz(); return 0; }
Source
From D:22767 by Robert.