What does C++ do better than D? - StackOverflow.com

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Aug 1 19:26:39 PDT 2011


On 8/1/11 8:29 PM, Andrei Alexandrescu wrote:
> On 8/1/11 6:30 PM, Adam Ruppe wrote:
>> Peter Alexander wrote:
>>> 1. The fact that you can't copy const struct objects containing
>>> reference types.
>>
>> I recently hit a similar problem. web.d uses a ParameterTypeTuple
>> to fill in arguments to the functions it calls in a generic way.
>>
>> With "in" arguments, assigning to the tuple isn't allowed! It says
>> "can't modify const".
>>
>> I decided to just not use const in there, and cast it away in the
>> wrapper function. I'm not happy with that, but I don't know what else
>> to do. (I generally like D's const and immutable, but blarg there are
>> some rough edges and I don't even know how to fix the design.)
>
> I know how to fix the design (in fact the implementation, the design is
> sound). It's just ever so difficult to find the time to prioritize for it.
>
> Overall I feel Peter's post on stackexchange did more bad than good (of
> course that doesn't mean he had the right;

s/had/didn't have/


Andrei


More information about the Digitalmars-d mailing list