toString() through interface

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 19 17:45:50 PDT 2014


On Sunday, 20 April 2014 at 00:35:30 UTC, David Held wrote:
> Since all implementations of an interface must derive from 
> Object

That's not true. They can also come from IUnknown or a C++ 
interface.

>     cast(Object)(foo).toString();

(cast(Object)foo).toString() might work


This might return null tho if it is a non-D object through the 
interface!


More information about the Digitalmars-d-learn mailing list