Re: Any easy way to check if an object have inherited an interface?

2019-07-23 Thread XavierAP via Digitalmars-d-learn
On Monday, 22 July 2019 at 21:34:18 UTC, solidstate1991 wrote: It seems that I've to write my own function that searches in the given object's classinfo.interfaces since I couldn't find anything related in Phobos. Do you mean...? interface I {} class C : I {} void main() { C c1;

Re: Any easy way to check if an object have inherited an interface?

2019-07-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/07/2019 9:34 AM, solidstate1991 wrote: It seems that I've to write my own function that searches in the given object's classinfo.interfaces since I couldn't find anything related in Phobos. if (Foo foo = cast(Bar)bar) { }

Any easy way to check if an object have inherited an interface?

2019-07-22 Thread solidstate1991 via Digitalmars-d-learn
It seems that I've to write my own function that searches in the given object's classinfo.interfaces since I couldn't find anything related in Phobos.