My tad’s vector is not properly updating after adding values on one of his methods

  adt, c++, vector

I am having issues with my adt’s vector attribute, first am fill in it up with a function but then when i try to get those values back, it seems like the vector is empty.

The adt:

template <class T, class X>
class Grafo
{
private:
   std::vector<T> vertices;
   std::vector<std::vector<X>> arista;

public:
   void insertarVertice(T s);
};

The method:

template <class T, class X>
void Grafo<T, X>::insertarVertice(T s)
{
    this->vertices.push_back(s);
}

The T and X classes are INT.

Source: Windows Questions C++

LEAVE A COMMENT