Dominance (C++)
In the C++ programming language, dominance implies a specific behaviour of symbol disambiguation in virtual inheritance. Consider the following example:
<source lang="cpp"> class Parent { public:
void function();
};
class Child1 : public virtual Parent { public:
void function();
};
class Child2 : public virtual Parent { };
class Grandchild : public Child1, public Child2 { public:
Grandchild()
{
function();
}
}; </source>
In the Grandchild call to function(), Child1::function is implied, because Child1 is derived from Parent and thus Child1::function "dominates" Parent::function.
See also
| Stub icon | This computer programming-related article is a stub. You can help Wikipedia by expanding it. |
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...