POV-Ray : Newsgroups : povray.off-topic : Standard libraries : Re: Standard libraries Server Time
6 Sep 2024 13:18:03 EDT (-0400)
  Re: Standard libraries  
From: Darren New
Date: 8 Mar 2009 13:29:03
Message: <49b4005f$1@news.povray.org>
Warp wrote:
> units), it will still return the correct typeid name depending on whether
> the object is really of type Alpha or of type Beta.

Does the typeid tell you anything but basically the name? It looks like 
there's just a textual name and a total (but otherwise undefined) ordering 
on types. No way to actually use the type information to do something I'd 
consider useful.  Is this the sort of thing that compilers extend, or is the 
only actual use to get the name of the type or compare types in a template?

It doesn't really look like the type information lets you do much with the 
contents of the type. It doesn't tell you anything about the type - it just 
tells you the ID of the type. It doesn't tell you how big it is, or which 
members are pointers, or anything like that that would let you do something 
like serialize the data out to a file. That's usually what I think of when I 
hear "run-time type information". Not "I can compare two values in a 
statically-typed language and see if they're the same type." :-)

-- 
   Darren New, San Diego CA, USA (PST)
   My fortune cookie said, "You will soon be
   unable to read this, even at arm's length."


Post a reply to this message

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