POV-Ray : Newsgroups : povray.programming : void pointer array problem : Re: void pointer array problem Server Time
28 Jul 2024 08:24:15 EDT (-0400)
  Re: void pointer array problem  
From: Warp
Date: 3 Jul 2002 13:12:19
Message: <3d233073@news.povray.org>
Thomas Willhalm <tho### [at] uni-konstanzde> wrote:
> No, it doesn't. It's just that the thing is named "object" instead of
> "void*". Furthermore, you are forced to use it, if you want to create
> generic container classes.

  Firstly, what is so bad about having to inherit your classes from a
common base class?
  Secondly, no-one forces you to do so. You can make a more rational design
by creating your own base class, which has common things to all classes.

> In C++, you can easily avoid void* in most
> if not all cases and still have static type checking.

  I can't think of any way of avoiding void* other than using a common
base class, as in Java.
  Of course you can make your container a template, but that doesn't allow
you to put objects of different types in that container. All the objects
must be of the same type.

> Thomas (who really misses templates/generics in Java)

  I think they are planning to add template support to Java.
  That's really funny when you think about how Java-freaks hate(d) templates.

-- 
#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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.