D - more or less power than C++?
Dave
Dave_member at pathlink.com
Sat Mar 4 08:16:59 PST 2006
"Walter Bright" <newshound at digitalmars.com> wrote in message
news:duab09$1arn$1 at digitaldaemon.com...
>I started a new thread for this:
>
> "Mike Capp" <mike.capp at gmail.com> wrote in message
> news:dua67i$12cr$1 at digitaldaemon.com...
>> 7. D has all (well, most of) the power of C++
>
> I see this often and am a bit perplexed by it. What power do you feel is
> missing?
>
> And what about the missing power in C++ - inline assembler, nested
> functions, contract programming, unit testing, automatic documentation
> generation, static if, delegates, dynamic closures, inner classes,
> modules, garbage collection, scope guard?
>
> What does D have to do to have more power than C++?
- stack allocation for auto classes
- ITI for function templates
- implicit ctors for fundamental types, e.g.: int* i = new int(10);
- ctors for structs to get rid of having to use static opCall().
- Fix this issue:
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/6036
The last 2 are for cases like:
template mypow(F) {
F mypow(F x, int i) {
if(i < 1) return F(1); // here
if(i & 1) if(i == 1) return x; else return x * mypow(x,i-1);
return sqr!(F)(mypow(x,i/2));
}
}
- Dave
More information about the Digitalmars-d
mailing list