title: User defined struct conversion as function's default parameter
body: <pre><code>public struct MyInt
  {
      public int csInt;
  
      public MyInt(int i)
      {
          csInt = i;
      }
  
      public MyInt(double d)
      {
          csInt = (int)d;
      }
  
      public static implicit operator MyInt(int value)
      {
          return new MyInt(value);
      }
  
      public static implicit operator MyInt(double value)
      {
          return new MyInt(value);
      }
  }
  
  
  int MyFunc(MyInt i = 0)
  {
      return -1;
  }
  </code></pre>
  
  <p>I want to implement a wrapper struct<code>MyInt</code> (simplified here) to accept <code>int</code> as default value (I know this is weird and unnatural, I just need it to comply other language format), but I meet error when I code like above, the error is at <code>int MyFunc(MyInt i = 0)</code> where VS2012 said:</p>
  
  <blockquote>
    <p>a value of type 'int' cannot be used as a default parameter because there are no standard conversions to Type MyInt</p>
  </blockquote>
  
  <p>As I know, int and double also defined as struct in C#. So I have tried follows:</p>
  
  <pre><code>int MyFunc(double i = (int)0)
  {
  return -1;
  }
  </code></pre>
  
  <p>It passed! Therefore I think type conversion is allowed in default parameter. </p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>Why can not use implicit type conversion for MyInt as default para?</li>
  <li>What does the <strong>standard conversions</strong> mean in VS error message, is it diff from implicit conversion defined in MyInt?</li>
  </ol>