Is there any way to define an interface that can implicitly convert to Object?

Nathan S. no.public.email at example.com
Wed Jul 10 08:03:30 UTC 2019


I want to be able to do things like:

---
bool isSame(Object a, Object b) { return a is b; }

interface SomeInterface { int whatever(); }

bool failsToCompile(SomeInterface a, SomeInterface b) { return 
isSame(a, b); }
---

>Error: function isSame(Object a, Object b) is not callable using 
>argument types (SomeInterface, SomeInterface)

Is there a way to declare an interface as explicitly not a COM 
interface or a C++ interface? Having to add "cast(Object)" 
everywhere is annoying.


More information about the Digitalmars-d-learn mailing list