Reddit: why aren't people using D?

Bill Baxter wbaxter at gmail.com
Thu Jul 23 17:05:40 PDT 2009


On Thu, Jul 23, 2009 at 3:21 PM, Walter
Bright<newshound1 at digitalmars.com> wrote:
> Rainer Deyke wrote:
>>    They're value types (non-copyable for the most part, but stored
>> directly instead of as pointers, with RAII), but they're often passed
>> around as polymorphic references.
>
> I.e. they're a mess. You just confused the heck out of me.

I think the case he's talking about is just a sort of optimization to
use stack allocation instead of heap alloc.

void func()
{
    DerivedFoo x;
    callMethodThatTakesAnyFoo(&x);
}

I.e. the kind of thing you'd use "scope Foo" for in D.

Except that in the C++ case you could have DerivedFoo be part of
another struct or class instead of being a local variable.

--bb



More information about the Digitalmars-d mailing list