search of a workaround

monarch_dodra monarchdodra at gmail.com
Sat Feb 9 04:20:02 PST 2013


On Saturday, 9 February 2013 at 12:10:57 UTC, Namespace wrote:

>> In particular, you can't pack classes in a table, for example.
> I don't understand.

I mean structs you can pack together in an array, eg:

S[10] s10; //10 structs S

You can't do that with classes. Sure, you can put 10 class 
*references* in an array, but the *instances* themselves need to 
be individually allocated.

This can be a problem if you want to represent an image, for 
example, and "S" is an RGB quad.


More information about the Digitalmars-d-learn mailing list