let's say I have this struct:
and this class:Code:struct H { K mK; // ... };
I thought this would assign C's mK to a copy of h.mK, but this is not happening. C's mK is behaving like it's being assigned to newly allocated memory that has been deleted. For example, the value in mK changes at random points in the application without ever explicitly changing the value.Code:class C { private: K mK; public: void foo(const H &h); // ... }; void foo(const H &h) { mK = h.mK; }