This may be a C++ thing I just don't understand, but here is my issue. I have a template class I made called List<T>. I want to use it inside another class (ClassA) and I define it like so in my header:
List<SomeObject> objects;
Then, I need to call a specific constructor of List<T> so i can set its size.
So in my ClassA constructor, I call it:
1 2 3 4 5 6 7 8 9
ClassA::ClassA(int _size)
{
//Why the hell is my list's default constructor called right here?
objects = List<T>(_size);
//That didn't work. Why is objects initialized with the default constructor?
//I saw it go through in debug, but the member is not updated?
}
Oh man... Ok, I'll have to remember that from now on. I'm just so used to C# and its elegance that things in C++ seem so backwards sometimes. :P Thanks for your help!