My basic question here is: Is the following code doing what I think its doing?
class Thing
{
private:
std::vector<int> numbers;
public:
Thing(const Thing& thing2)
{
numbers = thing2.numbers;
}
}
class Some_Other_Class
}
private:
Thing &second;
public:
Some_Other_Class(Thing &thisThing)
: second(thisThing);
{
}
}
int main()
{
Thing first;
Some_Other_Class(first);
}
Sorry if this is overly complex but I wanted to replicate the structure of things in my program to make sure I'm asking the right question. Long story short, I want to have a reference to a "Thing" object that is passed into another (temporary) object. I don't want a copy, and I think I'm doing that much correctly, however, am I copying "numbers" or does the second instance of Thing contain a reference to "numbers" (which is my intent)?