Avoiding abstract

Oliver Rübenkönig oliver.ruebenkoenig at web.de.REMOVE
Mon Jun 4 00:16:18 PDT 2007


Regan Heath Wrote:

> Something else you might want to look at is how std.socket manages to return a TcpSocket or UdpSocket from it's base class Socket method 'accept'.
> 
> The trick/magic is in the accepting() method which the derived class overrides, internally it creates a new derived class (TcpSocket, UdpSocket) returning it as a base class (Socket) reference to the base class 'accept' call which then assigns the internal socket handle and returns it.
> 
> You could do something very similar.

That sounds interesting. Thanks for the hint. I will have a look at it.
Oliver

> 
> Regan Heath



More information about the Digitalmars-d-learn mailing list