title: What is the reason for not allowing in C++ a default value for a variable to be a non-static method or member of a class?
body: <p>I wanted to know why the default value for a variable for a method of a class, cannot be a non-static method or member of the same class.</p>
  
  <p>Is there a reason for that ? Could not the compiler provide to the method the position in the class of the non-static default value ?</p>
  
  <p>I tried to google quickly for an answer but I could not come up with a good answer.</p>
  
  <p><strong>EDIT: here is an example.</strong></p>
  
  <p>This is legal:</p>
  
  <pre><code> class ClassTemp
  {
    static int s_member;
  
    int MagicOperation(int defaultValue = s_member)
    {
      return defaultValue;
    }
  };
  </code></pre>
  
  <p>But this is not:</p>
  
  <pre><code>class ClassTemp
  {
    int m_member;
  
    int MagicOperation(int defaultValue = m_member)
    {
      return defaultValue;
    }
  };
  </code></pre>