title: Is there a way to declare a class header in the same way a function header can be declared?
body: <pre><code>#include&lt;iostream&gt;
  
  using namespace std;
  
  class Colour
  {
  private:
      int _r, _g, _b;
  public:
      Colour(int r = 0, int g = 0, int b = 0) : _r(r), _g(g), _b(b) {}
  };
  class Purevirtual
  {
  public:
      virtual int f(int x)  = 0;
      virtual void setColour(const Colour &amp;c) = 0;
  };
  
  class Inherit : public Purevirtual
  {
  private :
      Colour _c;
  public:
      Inherit(const Colour &amp;c) : _c(c)
      {}
      int f(int x) override
      {
          return 2*x;
      }
      void setColour(const Colour &amp;colour) override
      {
          _c = colour;
      }
  };
  int main()
  {
      return 0;
  }
  </code></pre>
  
  <p>If I put the class Colour after Purevirtual at compile time it will generate an error. I don't know why. A solution is to create and include in the main file the header with the class Colour but for me, it seems it will complicate the code.</p>