I am trying to create a class that never duplicates as it has a LOT of data inside of its fields. To do this I defined the class like this:
class Foo {
public:
Foo(int i);
Foo();
Foo(const Foo&) = delete;
}
This causes a compiler error if I tried to do something like:
Foo a(2);
Foo b = a;
However for whatever reason this does not cover this scenario where data is copied.
Foo* array;
array = new Foo[10000];
Foo a(2);
array[1] = a;
Why is this?