title: Trouble with const/non-const overload resolution
body: <p>I have a class that looks something like this:</p>
  
  <pre><code>class ClassA
  {
    public:
      float Get(int num) const;
    protected:
      float&amp; Get(int num);
  }
  </code></pre>
  
  <p>Outside of the class, I call the Get() function. </p>
  
  <pre><code>float foo = classAInstance.Get(i);
  </code></pre>
  
  <p>I expect this to call the public version, but instead Visual Studio errors out:</p>
  
  <pre><code>error C2248: 'ClassA::Get' : cannot access protected member declared in class 'ClassA'
  </code></pre>
  
  <p>When commenting out the protected overload and removing all references to it, the code compiles. </p>
  
  <p>Why does the compiler try to use the inaccessible member when an accessible one is available? Is there an accepted way to force the compiler to choose the correct overload? Is there a reference to the resolution rules for member functions somewhere?</p>