C++: Diamond concerns -



C++: Diamond concerns -

simple question: hierarchy cause dp?

//abstract base of operations class class { //implement pure virtual methods default definition. //pure virtual methods still declared pure virtual. }; //abstract derived class class b : public { //define pure virtual methods default definition. //pure virtual methods still declared pure virtual. }; //abstract base of operations class class c { //define pure virtual methods default definition. //pure virtual methods still declared pure virtual. }; //concrete class class d : public b, public c { //implement methods d, b, , c };

no. draw picture; bases unique:

a | v b c \ / v d

the "diamond problem" pertains ambiguous base of operations classes due multiple repeated bases, e.g. if d derive both a -> b , a -> c:

class="lang-none prettyprint-override">no-diamond-problematic: virtually-inherited diamond: | | v/ \v b c b c \ / \ / v v d d

c++ diamond-problem

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -