What is the best way to deal with this?

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Feb 23 20:15:55 PST 2013


On 2/24/13, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> You could create a base class for all:
>
> class TestBase
> {
> private: // or protected?
>     __gshared TestBase[] globalInstances;
> ... // same as what you have
> }
>
> class TestClass(T) : TestBase
> {
>     ...
> }

Ah that's much better than my solution, cool. Mine was extracted from
this enhancement request:
http://d.puremagic.com/issues/show_bug.cgi?id=9088


More information about the Digitalmars-d mailing list