Interface question

Reiner Pope reiner.pope at
Mon Aug 28 23:49:53 PDT 2006

Charles D Hixson wrote:
> How should I write some code that would have an effect similar to what:
> interface P
> {  this(ulong ndx);
>    ulong   fset();
> }
> would have if it were a legal construct?
> The "constructor" needs to return an instance of the class that 
> implements it.
I think you have to use the factory pattern:

interface P
	ulong fset();

interface PFactory
	P create();

More information about the Digitalmars-d-learn mailing list