This is my class
#include <vector>
class MyClass
{
public:
void print(); // prints X to console
private:
std::vector<int> X (4, 100);
};
When I call the print()
method I want X
to be passed by constant reference to print()
. How can I do that? Currently is looks like as X
is passed by value.