title: Class isn't abstract but I get Error C2259: cannot instantiate abstract class
body: <p>I'm trying to implement a Strategy pattern in C++, but I get the following error:</p>
  
  <p>Error 1 error C2259: 'LinearRootSolver' : cannot instantiate abstract class</p>
  
  <p>Here's my code (the line where the error is, is marked with a comment).
  Class that uses strategy pattern (context):</p>
  
  <pre><code>bool Isosurface::intersect(HitInfo&amp; result, const Ray&amp; ray, float tMin, float tMax) {
      INumericalRootSolver *rootSolver = new LinearRootSolver(); // error here
      [...]
  }
  </code></pre>
  
  <p>And here's my strategy pattern classes:</p>
  
  <pre><code>class INumericalRootSolver {
  public:
      virtual void findRoot(Vector3* P, float a, float b, Ray&amp; ray) = 0;
  };
  
  class LinearRootSolver : public INumericalRootSolver {
  public:
      void findRoot(Vector3&amp; P, float a, float b, Ray&amp; ray) {
          [...]
      }
  };
  </code></pre>
  
  <p>I can't see why I get an error for trying to instantiate an abstract class in the intersect method at the top?</p>