Rule 10-3-3 Re-declaring pure function

Moderators: david ward, misra cpp

nishiyama
Posts: 5
Joined: Tue Mar 13, 2018 7:58 am
Company: Denso Create

Rule 10-3-3 Re-declaring pure function

Postby nishiyama » Tue Feb 05, 2019 3:57 am

Hi.

Rules 10-3-3 Rationale has the following description.

Re-declaring a function as pure may not meet developer expectations.

What do the developers expect?
What does it mean that it does not meet the expectations of developers?

dg1980
Posts: 107
Joined: Wed Apr 27, 2016 2:33 pm
Company: Elektrobit Automotive GmbH

Re: Rule 10-3-3 Re-declaring pure function

Postby dg1980 » Fri Feb 08, 2019 7:17 am

Hi,

for the example provided by this rule it means:

Code: Select all

A a;// compile-time error: A is abstract
B b;// ok
C c;// compile-time error: C is abstract again


The last line is the one which does not meet common developer expectations when looking at the class hierarchy.


Return to “6.10 Derived classes (C++)”

Who is online

Users browsing this forum: No registered users and 0 guests