I have a class in c++ a portion of which is below
class Node{
public:
vector<string> getNames() const;
private:
vector<string> names_;
};
vector<string> Node::getNames(){
return names_;
}
the function getNames() passes a copy of the vector. How can i modify my class so that i can reference the vector 'by const reference' from any other class that i declare the Node object instead of passing a copy?