lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] master 084f1b49 5/5: Make a different virtual pu


From: Greg Chicares
Subject: Re: [lmi] [lmi-commits] master 084f1b49 5/5: Make a different virtual pure
Date: Sat, 16 Jul 2022 00:00:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 7/12/22 13:42, Greg Chicares wrote:
> On 7/12/22 11:34, Vadim Zeitlin wrote:
>> On Mon, 11 Jul 2022 22:53:09 -0400 (EDT) Greg Chicares 
>> <gchicares@sbcglobal.net> wrote:
>> 
>> GC> branch: master
>> GC> commit 084f1b493d38aea81cb6efa174751bbb82ebaef2
>> GC> Author: Gregory W. Chicares <gchicares@sbcglobal.net>
>> GC> Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
>> GC> 
>> GC>     Make a different virtual pure
>> 
>>  How was the choice of the function to be made pure done here? I.e. why did
>> you decide to make allowed_keywords() pure and not, say, default_keyword()?
> 
> I picked the only one that would actually compile with no further changes.
> 
> Class payment_sequence overrides only these three member functions:
>     numeric_values_are_allowable() const override
>     keyword_values_are_allowable() const override
>     allowed_keywords() const override
> and the first two are called by assert_sanity(), so they mustn't be pure.

Consider assert_sanity(). Aside from block_keyword_values()
(which was used in the past, but is no longer used), only
base-class ctors call assert_sanity(). Because it's called
only in base-class ctors, it tests the sanity only of the
base-class state--the derived classes override the function
calls it makes, but no derived class exists at this point.

This defect should be easy to fix.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]