D - more or less power than C++?

Kevin Bealer Kevin_member at pathlink.com
Fri Mar 3 20:49:50 PST 2006


Making two clarifications:

In article <dub5c4$2lo2$1 at digitaldaemon.com>, Kevin Bealer says...
>
>
>First, let me say, that on balance, D is more powerful than C++ in many ways,
>and moreso when implicit template etc gets here.  But there are things C++ can
>do that D can't.  C++ templates and macros can do lots of things.  I agree with
>not putting C style macros in D; but to be fair, its still powerful, if ugly and
>unsymmetric.
>

(I was going to go one sentence further, and say "Some of these could probably
be done in D with real language features instead of macros" but I couldn't think
of anything right now...)

>That said, I wanted to make a few points about Andrew's item #1...
>
>In article <duaqm9$25at$1 at digitaldaemon.com>, Walter Bright says...
>>
..
>
>Unfortunately, if I have a container of D structs, getting one out and calling a
>method, copies the value out - I can't set fields via "container[i].x = 5;" the
>last time I checked.


I'm remembering this from a long discussion here before.  Since I wrote this I
figured out that you can write "foo * opIndex(int i) { return & foo; }" and get
the functionality I wanted.

>Kevin





More information about the Digitalmars-d mailing list