Search code examples
d

How do I get the default value of a generic type?


I'm using the D language, and would like to get the default value of a generic type, similar to the way default(T) works in C#. Is this possible? If not - what are the possible workarounds?


Solution

  • I think T.init might be what you're looking for.