www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - iftype on struct or class?

reply clayasaurus <clayasaurus gmail.com> writes:
Is it possible to use iftype to determine if T is a class or a struct? 
Or is there a better way?

I havn't had any luck. :-/ thx.
May 28 2005
next sibling parent Hasan Aljudy <hasan.aljudy gmail.com> writes:
clayasaurus wrote:
 Is it possible to use iftype to determine if T is a class or a struct? 
 Or is there a better way?
 
 I havn't had any luck. :-/ thx.
All classes inherit from Object. I haven't tried using iftype, but if it works on super classes, then you can check if the type is "Object". if it is, it's probably a class.
May 28 2005
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
"clayasaurus" <clayasaurus gmail.com> wrote in message
news:d7ame3$1b33$1 digitaldaemon.com...
 Is it possible to use iftype to determine if T is a class or a struct?
You can determine if it's a class by using :Object. Being able to tell if it is a struct, union, interface, enum, etc., is coming in the next version.
May 28 2005
next sibling parent reply clayasaurus <clayasaurus gmail.com> writes:
Walter wrote:
 "clayasaurus" <clayasaurus gmail.com> wrote in message
 news:d7ame3$1b33$1 digitaldaemon.com...
 
Is it possible to use iftype to determine if T is a class or a struct?
You can determine if it's a class by using :Object. Being able to tell if it is a struct, union, interface, enum, etc., is coming in the next version.
does etc. include arrays? : )
May 29 2005
parent clayasaurus <clayasaurus gmail.com> writes:
clayasaurus wrote:
 Walter wrote:
 
 "clayasaurus" <clayasaurus gmail.com> wrote in message
 news:d7ame3$1b33$1 digitaldaemon.com...

 Is it possible to use iftype to determine if T is a class or a struct?
You can determine if it's a class by using :Object. Being able to tell if it is a struct, union, interface, enum, etc., is coming in the next version.
does etc. include arrays? : )
nevermind *doh*
May 29 2005
prev sibling parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
 Being able to tell if it
 is a struct, union, interface, enum, etc., is coming in the next version.
Sounds very promising :) Just one question: next version or build? :) Andrew.
May 29 2005
parent "Walter" <newshound digitalmars.com> writes:
"Andrew Fedoniouk" <news terrainformatica.com> wrote in message
news:d7e8qg$148c$1 digitaldaemon.com...
 Being able to tell if it
 is a struct, union, interface, enum, etc., is coming in the next
version.

 Sounds very promising :) Just one question: next version or build? :)
build
May 31 2005