Declaring STL Data Structures such as Vector in the .h
- by sc_ray
I am trying to declare a private Data Structure such as the Vector in my C++ header file which I want to eventually use within the method implementation of my .cpp.
An example would be my header "SomeClass.h" where I have:
class SomeClass
{
private:
Vector<T> myVector;
public:
void AddTtoMyVector(T add);
}
And in my .cpp which is "SomeClass.cpp", I have the following:
#include "SomeClass.h"
SomeClass::AddTtoMyVector(T add)
{
myVector.Push_back(add);
}
Would the syntax here work? Or is there a different way of declaring and populating such structures?