Cumulative

John Colvin john.loughran.colvin at gmail.com
Fri Mar 7 01:04:28 PST 2014


On Friday, 7 March 2014 at 06:18:47 UTC, Steve Teale wrote:
> On Friday, 7 March 2014 at 02:15:44 UTC, Nick Sabalausky wrote:
>> On 3/6/2014 11:48 AM, Steve Teale wrote:
>>>
>>>>
>> class MyBaseClass {
>>    bool addHandlersCalled = false;
>>    bool delegate(int)[] handlers;
>>
>>    /// Subclasses must call this in their ctor.
>>    protected void addHandlers(bool delegate(int)[] handlers)
>>    {
>>        this.handlers = handlers;
>>        addHandlersCalled = true;
>>    }
>>
>>    invariant() {
>>        assert(addHandlersCalled);
>>    }
>> }
>
> Thanks Nick. A voice of sanity. Interestingly I'd decided on 
> the argument to the constructor while programming in bed last 
> night.
>
> The change of fashion is very noticeable though - structs for 
> everything seems to be a mantra these days. I have started to 
> wonder if the two styles could be bridged somewhat if we had 
> the default class method type as virtual, and then 'plain' 
> functions as well as final ones.
>
> Steve

How would these plain functions be different from final ones?


More information about the Digitalmars-d mailing list