"not an lvalue"

CrypticMetaphor CrypticMetaphor88 at gmail.com
Sun May 1 07:30:00 PDT 2011


On 5/1/2011 3:53 PM, Dmitry Olshansky wrote:
> Ehm.. Well, first things first: you shouldn't use classes for
> lightweight & plain data things like vectors. There are structs for
> that. In general, structs are value-like objects living on the stack
> while classes are reference-like objects living on the heap.  Your
> current code is going to allocate on GC heap new vector in every
> GetColumn and I suspect also when adding two vectors.

Yes, I will change that, thank you. Btw, I'd like to mention that in 
addition to being allocated on the heap, classes also be 2 pointers 
larger because of the hidden __vptr and __monitor.


More information about the Digitalmars-d-learn mailing list