Files
cppdraft_translate/cppdraft/class/paths.md
2025-10-25 03:02:53 +03:00

22 lines
759 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[class.paths]
# 11 Classes [[class]](./#class)
## 11.8 Member access control [[class.access]](class.access#class.paths)
### 11.8.7 Multiple access [class.paths]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/classes.tex#L5284)
If a declaration can be reached by several paths through a multiple inheritance
graph, the access is that of the path that gives most access[.](#1.sentence-1)
[*Example [1](#example-1)*: class W { public: void f(); };class A : private virtual W { };class B : public virtual W { };class C : public A, public B {void f() { W::f(); } // OK};
SinceW::f() is available toC::f() along the public path throughB,
access is allowed[.](#1.sentence-2)
— *end example*]