Feature request - simpler constructors

Janice Caron caron800 at googlemail.com
Fri Sep 21 00:24:13 PDT 2007


On 9/21/07, kris <foo at bar.com> wrote:
> Here's a thought for everyone to consider. Please take a look at a large
> and /practical/ body of code, written in D, by capable programmers, and
> actually count the number of times this would even be applied?

Are you saying it's /rare/ to assign a member variable from a
constructor parameter?

Or are you just saying it's rare to use the "this.x" notation. I know
I usually give my member variables different names from parameter
names to avoid having to do that. I don't have a large body of D to
look at, but I certainly see

T(U x_, V y_) : x(x_), y(y_) {}

a lot in C++ (as well as initialisation by assignment within the
constructor body, by less experienced programmers).



More information about the Digitalmars-d mailing list