I'm trying to set up a object with an vector as a member field. I set up the constructor, and as far as I'm aware it does initialize this member variable, but I am getting an error when I try to access the vector unless I initialize it within the function calls of the object. I'm getting a warning saying 

`C26495: Variable 'Engy::Graphics::Shape2D::m_vertices' is uninitialized. Always initialize a member variable (type.6).`

The thing is, I did initialize it in my constructor. Is there anything vital I'm missing? Here's my code:

**Class declaration (Header File)**

```
class Shape2D:Object
        {
            protected:
                std::vector<Vector> *m_vertices;
                int type = GL_QUADS;
            public:
                Shape2D(std::vector<Vector> vertices);
                Shape2D();
                void draw();
                void setVector(int index, Vector value);
                Vector getVector(int index);
                void translate(double x, double y);
                void createVector(int i, double x, double y);
                void createVector(double x, double y);
                void addVector(Vector value);
        };

```

**Method declaration (.cpp file)**

```
Shape2D::Shape2D(std::vector<Vector> vertices)
{
    std::vector<Vector> m_vertices = vertices;
}
Shape2D::Shape2D()
{
    std::vector<Vector> *m_vertices = new std::vector<Vector>;
}

void Shape2D::setVector(int index, Vector value)
{
    //THIS PART RIGHT HERE IS WHAT I HAVE TO DO TO MAKE IT NOT CRASH, BUT I DONT WANT TO HAVE TO PUT THIS EVERYWHERE
    if (!m_vertices)
    {
        m_vertices = new std::vector<Vector>;
    }
    if (m_vertices->size() < index)
    {
        m_vertices->assign(index - m_vertices->size(), NULL);       
    }
    m_vertices->at(index) = value;
}

```

**Object Creation**

```
    //Rectangle is a subclass of Shape2D which calls the default constructor of Shape2D then runs calls to add the constructor inputs in (Let me know if you would like to see that code)
    Rectangle r(0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.0, 0.5);

```

Thank you guys!