What do i need to do to the following code in order for it to output the values of A
and B
? You can edit and compile it here if you like.
typedef const std::vector<int>& t;
class SomeClass
{
t data;
public:
SomeClass(t _data) : data(_data) {}
void disp()
{
for (auto v : data)
std::cout << v << ", ";
std::cout << std::endl;
}
};
int A = 1;
int B = 2;
SomeClass f = SomeClass( {A, B} );
f.disp();
A = 456;
f.disp();