Using templates to switch interface implementation class

Tom S h3r3tic at remove.mat.uni.torun.pl
Sun May 21 13:00:52 PDT 2006


I'm attaching the best solution I could come up with...
The binding is done in a static module ctor. Creating an 'implementation 
instance' for a given interface incurs a cost of a virtual function call 
and there's a minimal storage penalty, but at least it's not very 
hackish and its usage is very simple.


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O 
!M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp2.d
Type: text/x-dsrc
Size: 749 bytes
Desc: not available
Url : http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20060521/ca717447/attachment.d 


More information about the Digitalmars-d-learn mailing list