www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - typeid of structs vs classes

reply Tom S <h3r3tic remove.mat.uni.torun.pl> writes:
I've been wondering why does typeid(Foo).toString (where Foo is a struct 
name) return "MODULE_NAME.Foo", while typeid(Bar).toString (where Bar is 
a class) returns just "Bar". Is there any reason for it ? How about 
unifying these ?



-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O 
!M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/
Jan 03 2006
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Tom S wrote:
 I've been wondering why does typeid(Foo).toString (where Foo is a struct 
 name) return "MODULE_NAME.Foo", while typeid(Bar).toString (where Bar is 
 a class) returns just "Bar". Is there any reason for it ? How about 
 unifying these ?

So there are at least a few bugs with what TypeInfo.toString returns for various types. Here's another: digitalmars.D.bugs/4387 Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jan 05 2006