H
hufaunder
I have an interface for which I want to define a particular
constructor. I want to force the user to implement this particular
constructor. Even better would be if I could make sure there is no
default constructor. That might be a bit messy because the implementer
of the interface should have the freedom to add any
function/constructor he wants on top of the interface. But can't I at
least force that one particular constructor must be present? I tried it
but got the following error "Interfaces cannot contain constructors".
Therefore, I wonder if it is impossible to do what I want to do. If so
where does this limitation come from?
Thanks
constructor. I want to force the user to implement this particular
constructor. Even better would be if I could make sure there is no
default constructor. That might be a bit messy because the implementer
of the interface should have the freedom to add any
function/constructor he wants on top of the interface. But can't I at
least force that one particular constructor must be present? I tried it
but got the following error "Interfaces cannot contain constructors".
Therefore, I wonder if it is impossible to do what I want to do. If so
where does this limitation come from?
Thanks