title: Vector of Custom Objects
body: <p>I am trying to create a vector of custom objects defined in a header file and then initialize them in the actual cpp file. I'm getting the following errors in Visual Studio:</p>
  
  <pre><code>error C2976: 'std::vector' : too few template arguments
  error C2065: 'Particle' : undeclared identifier
  error C2059: syntax error : '&gt;'
  </code></pre>
  
  <p>In the code below, the vector is defined in Explosion.h.</p>
  
  <h3>Particle.h:</h3>
  
  <pre><code>#pragma once
  class Particle : public sf::CircleShape {
  public:
      float speed;
      bool alive;
      float vx;
      float vy;
      Particle(float x, float y, float vx, float vy, sf::Color color);
      ~Particle();
  };
  </code></pre>
  
  <h3>Particle.cpp:</h3>
  
  <pre><code>#include &lt;SFML/Graphics.hpp&gt;
  #include "Particle.h"
  
  Particle::Particle(float x, float y, float vx, float vy, sf::Color color) {
      // Inherited
      this-&gt;setPosition(x, y);
      this-&gt;setRadius(5);
      this-&gt;setFillColor(color);
  
      // Player Defined Variables
      this-&gt;speed = (float).05;
      this-&gt;alive = true;
      this-&gt;vx = vx;
      this-&gt;vy = vy;
  }
  
  Particle::~Particle() {
  }
  </code></pre>
  
  <h3>Explosion.h:</h3>
  
  <pre><code>static const int NUM_PARTICLES = 6;
  
  #pragma once
  class Explosion {
  public:
      std::vector&lt;Particle*&gt; particles;
      bool alive;
      Explosion();
      ~Explosion();
  };
  </code></pre>
  
  <h3>Explosion.cpp:</h3>
  
  <pre><code>#include &lt;SFML/Graphics.hpp&gt;
  #include "Particle.h"
  #include "Explosion.h"
  
  Explosion::Explosion() {
      this-&gt;alive = true;
  
      // Add Particles to vector
      for (int i = 0; i &lt; NUM_PARTICLES; i++) {
          this-&gt;particles.push_back(new Particle(0, 0, 0, 0, sf::Color::Red));
      }
  }
  
  Explosion::~Explosion() {
  }
  </code></pre>
  
  <p>I'm sure there is something fundamentally wrong here since C++ is fairly new to me.</p>