Top 5

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Oct 11 12:42:14 PDT 2008


Sergey Gromov wrote:
> Sat, 11 Oct 2008 09:55:19 -0500,
> Andrei Alexandrescu wrote:
>> Denis Koroskin wrote:
>>> On Sat, 11 Oct 2008 18:32:25 +0400, Andrei Alexandrescu 
>>> <SeeWebsiteForEmail at erdani.org> wrote:
>>>
>>>> Denis Koroskin wrote:
>>>>> On Sat, 11 Oct 2008 18:00:38 +0400, Andrei Alexandrescu Two notes:
>>>>> 1) I thought Appender would have an 'append' method as well as 
>>>>> opCatAssign.
>>>> Appender has write because it is an output range. That way you can 
>>>> direct any algorithm that uses output iterators to append to an array.
>>>>
>>> BTW, I wouldn't know that Appender is a range if you didn't say it. I 
>>> believe it should be specified (and enforced) somehow in the code, like 
>>> 'implements the output range contract' (C++0x contracts come to mind). 
>>> For example, an error could be risen if Output Range definition is 
>>> changed and Appender is not updated yet.
>> Walter is considering allowing structs to inherit from interfaces.
> 
> I think Appender should be a class.  It's obviously non-copyable, it's 
> not too convenient to pass structs by pointers, and I don't think you 
> need so many appenders sitting around that they being heap objects 
> should become a concern.

I didn't want to force a dynamic allocation just to store a little 
structure.

Andrei



More information about the Digitalmars-d mailing list