title: Struct with initially invalid fields
body: <p>I'm trying to create a struct that has two fields that I can check for being valid/invalid directly after creation. since the two fields are <code>0</code> by default, I'd like to check them for being invalid if they are <code>-1</code> ...</p>
  
  <pre><code>public struct InputCodeSet
  {
      public int primary;
      public int secondary;
  
  
      public InputCodeSet(int primary = -1, int secondary = -1)
      {
          this.primary = primary;
          this.secondary = secondary;
      }
  
      public bool IsValid
      {
          get { return primary &gt; -1 &amp;&amp; primary &lt; InputCode.MAX &amp;&amp; secondary &gt; -1 &amp;&amp; secondary &lt; InputCode.MAX; }
      }
  }
  </code></pre>
  
  <p>However testing any created <code>InputCodeSet</code> results in <code>IsValid</code> always being true after creation, even if a primary or secondary wasn't set. Obviously the default values in optional constructor parameters are being ignored? Any other ways to get this working? I'd like to use mainly object initializer syntax with them ...</p>
  
  <pre><code>var inputCode1 = new InputCodeSet { primary = InputCode.55 }
  </code></pre>