|
![](/i/fill.gif) |
Thorsten Froehlich <tho### [at] trf de> wrote:
> The proper way is to inherit everything array can hold from a common
> base class and let array point to those.
Yes, that's the right way of doing it. This is one thing where Java
*forces* you to make good code: There is no void*, but you must use
inheritance instead in order to achieve this.
Also, I'm not sure if the ISO-C++ standard guarantees that a
pointer-to-class will always have the same size as void*.
If the standard does not guarantee this, then theoretically storing
a pointer-to-class into a void* may lead to non-portable code (even though
every single C++ compiler I know uses regular pointers for classes as well,
so this is just very theoretical).
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |