Associative Array of Const Objects?

bitwise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 29 13:29:49 PDT 2015


> 1) Such placement based syntax is foreign to D.

I would have to agree that this is a strange way to do things in 
any language.
The great "int* a" vs "int *a" debate...

> 2) It would be special syntax just for class types.
IMO, it would be worth it

> 3) It's not how C++ rolls.
> `const Test test;` and `Test const test;` are equivalent in 
> C++. You need that '*' in C++, too, to make a distinction 
> between reference and data.

I'm a little confused. I was comparing a C++ pointer-to-class to 
a D reference, which are basically the same under the hood. I 
wasn't trying to bring up C++ value types. I'm not sure how 
they're relevant to the argument.

> 4) Rebindable works reasonably well, as far as I know.

The verbosity and blatant disregard for DRY makes me CRY.
See what I did there.. ;)

Anyways, IMO, D could benefit from having "tailconst" but I think 
it's a moot point.


More information about the Digitalmars-d-learn mailing list