why can't structs implement interfaces?

Moritz Warning moritzwarning at web.de
Tue Nov 24 14:28:31 PST 2009


On Tue, 24 Nov 2009 21:55:02 +0100, Saaa wrote:

> struct S : Pos {}
> Why is this not possible?

The struct would need an additional pointer
for a dispatch table in case you want to have class semantics.

If you only what a contract that certain functions are implemented,
then it just need to be implemented in the compiler frontend.


More information about the Digitalmars-d-learn mailing list