If I have an array of some class, and that class has const members, is there some way I can call a custom constructor on elements of the array?
I can't seem to reinitialize an element in foos in the example below. A thread on stack overflow mentioned the copy constructor show allow it, but I get "no match for call to '(Foo) (Foo&)'" when I try it.
Foo(int x, int y);
Foo(const Foo &foo);
const int m_x;
const int m_y;
Foo::Foo() : m_x(0),
Foo::Foo(int x, int y) : m_x(x),
Foo::Foo(const Foo &foo) : m_x(foo.m_x),
Foo foo2(2, 3);
foos = Foo(2,3);