Disable GC entirely

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Apr 10 11:47:01 PDT 2013


On 4/10/13 2:26 PM, Andrej Mitrovic wrote:
> On 4/10/13, Andrei Alexandrescu<SeeWebsiteForEmail at erdani.org>  wrote:
>> On 4/10/13 1:33 PM, Manu wrote:
>>>      It may as well be a mistake that nonvirtual functions are at all
>>>      part of a class' methods. This has been quite painfully seen in C++
>>>      leading to surprising conclusions: http://goo.gl/dqZrr.
>>>
>>>
>>> Hmm, some interesting points. Although I don't think I buy what he's
>>> selling.
>>
>> That article ain't sellin'. It's destroyin'.
>
> UFCS can't be the penultimate solution, for example:
>
> class S(T)
> {
>      alias Type = SomeTypeModifier!T;
>
>      static if (isSomePredicate!Type)
>      {
>          int x;
>          void foo() { /* do something with x */ }
>      }
>      else
>      {
>          float y;
>          void bar() { /* do something with y */ }
>      }
> }
>
> How do you implement this with UFCS? It wouldn't look nice if you had
> to put those methods outside, while keeping the data inside. You'd
> have to duplicate static ifs outside and inside the class.

Agreed.

Andrei


More information about the Digitalmars-d mailing list