title: Invalid use of this in a non static member function
body: <p>I got the following class:</p>
  
  <pre><code>class Foo {
  private:
      static float scale;
  
  public:
      static float setScale(float scale);
  };
  </code></pre>
  
  <p>When I am trying to implement setScale like this:</p>
  
  <pre><code>float Foo::setScale(float scale) {
     this-&gt;scale = scale;
     return scale;
  }
  </code></pre>
  
  <p>It throws an error: </p>
  
  <blockquote>
    <p>Invalid use of 'this' outside of a non-static member function.</p>
  </blockquote>
  
  <p>I really don't get this since my function is marked static.</p>
  
  <p>I saw some related questions but it didn't answer my question.</p>
  
  <p>So how can I fix this?
  I know I can change the names and don't use <code>this</code> but there probably is a solution for this?</p>
  
  <p>EDIT: Also when I implement the function inside the class it still throws the same error.</p>