On Saturday, 23 January 2016 at 21:06:32 UTC, Adam D. Ruppe wrote:
Are you sure you correctly casted first?
Nope sorry. Thanks for the help!!
On Saturday, 23 January 2016 at 21:03:21 UTC, Josh Phillips wrote:
I tried this but it will return A not B
Are you sure you correctly casted first?
On Saturday, 23 January 2016 at 21:03:21 UTC, Josh Phillips wrote:
On Friday, 22 January 2016 at 23:44:34 UTC, Adam D. Ruppe wrote:
There's a .classinfo property that works on Objects.
If you have an interface, cast to Object first, and check for
null, then get .classinfo off that.
I tried
On Friday, 22 January 2016 at 23:44:34 UTC, Adam D. Ruppe wrote:
There's a .classinfo property that works on Objects.
If you have an interface, cast to Object first, and check for
null, then get .classinfo off that.
I tried this but it will return A not B
If I have:
interface A {}
class B : A {}
void printClass(A obj){
// Code here
}
Is there any way that I can find out what class obj is inside of
printClass? I know I can cast and check if(cast(B)obj) but I want
to just be able to do something along the lines of obj.class. I
can think of
On Friday, 22 January 2016 at 23:38:58 UTC, Josh Phillips wrote:
Is there any way that I can find out what class obj is inside
of printClass?
There's a .classinfo property that works on Objects.
If you have an interface, cast to Object first, and check for
null, then get .classinfo off that.