title: How to generically initialize a value type with its default value?
body: <p>In the context of Java's <a href="https://wiki.openjdk.java.net/display/valhalla/Main" rel="nofollow noreferrer">Project Valhalla</a>, how can I <strong>generically</strong> initialize a <a href="http://openjdk.java.net/jeps/169" rel="nofollow noreferrer">value type</a> with its default value?</p>
  
  <p>Initially, I thought that assigning <code>null</code> to any value type would perform this initialization. However, the answers and comments to <a href="https://stackoverflow.com/q/48694891/1876620">this question</a> clearly show that <code>null</code> is a <em>reference</em>, so it has nothing to do with value types (precisely due to the fact that value types are not references, but direct values instead).</p>
  
  <p>E.g. if I have a <code>Person</code> value type with <code>StringValueType name</code> and <code>DateValueType dateOfBirth</code> attributes (here <code>dateOfBirth</code> would be a nested value type containing <code>int year</code>, <code>int month</code> and <code>int day</code> attributes), how could I initialize my <code>Person</code> value type <strong>in a generic way</strong> so that the values of its attributes are <code>""</code> for <code>name</code> and <code>(0, 0, 0)</code> (or the corresponding default value) for <code>dateOfBirth</code>, respectively?</p>
  
  <p>To make it more clear, if this were C, I would do:</p>
  
  <pre><code>memset(myPersonStructVariable, 0, sizeof(Person));
  </code></pre>
  
  <p>Or in modern C:</p>
  
  <pre><code>struct Person myPersonStructVariable = {0};
  </code></pre>