Skip to content

Commit 9648b3b

Browse files
TaojunshenColin RobertsonTylerMSFTopbld15TylerMSFT
authored
9/2/2021 AM Publish (#3752)
* draft * fix code sample (#3676) * fix code sample * acrolinx Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> * document clocks * add tai-clock * Address 3269 typo in warning number (#3680) * Fixed typo: evalution --> evaluation * updates * finish draft of new clocks * acrolinx * Fixed typo: evalution --> evaluation * Bulk Fix - Sentence form for all alt text (#3683) * Updated C/C++ workload name The workload for C/C++ development in VS Build Tools 2019 installer is called 'Desktop development with C++'. * Split out docs by version Add VS2017-specific instructions. * Updated C/C++ workload name The workload for C/C++ development in VS Build Tools 2019 installer is called 'Desktop development with C++'. * Split out docs by version Add VS2017-specific instructions. * Add 16.11 Compiler Warnings C5247 and C5248 (MicrosoftDocs#3689) * Add C5247 and C5248 * Fix link typos * Updates per Xiang Fan review * More wordsmithage * More fix per X.F. * Fix inconsistencies in CMake docs (MicrosoftDocs#3692) * Standard format for CMake docs * Fix markdownlint * More cleanup. * Clean up link issue, acrolinx * Fix more broken things * Undo a change * Add documentation for "unspecified" architecture Add documentation regarding "unspecified" architecture such that it provides an option for someone to ensure that no inherited environment is selected. * Update markdownlint.json file for unordered lists (#3694) Block rule that wants * instead of - to prefix unordered lists, since we've standardized on the latter. Merging on my own recognizance as repo admin. * Clean up documentation for "unspecified" architecture * Markdown quality fixes 1 of N * Markdown quality fixes 2 of N * Markdown quality fixes 3 of N * Markdown quality fixes 4 of N * Markdown quality fixes 5 of N * Markdown quality fixes 6 of N * Markdown quality fixes 7 of N * Markdown quality fixes 8 of N * Markdown quality fixes 9 of N * Markdown quality fixes 10 of N * Undo TN038 * Markdown quality fixes 11 of N * Setting PATH allows DUMPBIN to be executed from the system command prompt. There are multiple DUMPBIN.EXE's in the MSVC folder, but they can be executed if the PATH is set correctly. If this is not true, or undesireable per system design constraints, please clarify otherwise. * Call out toolchains and embedded scenarios * Add link to environment setting instructions * Make more readable * Address cpp-docs 3286 Postfix increment, decrement syntax (MicrosoftDocs#3711) * Address cpp-docs issue 3286 * Fix formatting, final example * Add compiler warning C5243, C5249, C5250 (MicrosoftDocs#3710) * Removing linux and non-windows bullet point * Make clear it's not required to meet all conditions Add "or" to final bullet point * PR review edit, Microsoft style for lists * Make the "unspecified" architecture option more general * Add __SANITIZE_ADDRESS__ to predefined macros page Noticed __SANITIZE_ADDRESS__ was missing from this list. * Add VS version Also note the VS version where __SANITIZE_ADDRESS__ was added in. * Add docs on using existing cache without cmake-server * Fix unescaped <chrono> (MicrosoftDocs#3715) Noticed this while doing other changes. Without being in a code block, <chrono> becomes the html element of the same name. * Address issue 3301 * Create and integrate /Zc:lambda article (#3719) * Create and integrate /Zc:lambda article * Fix conformance topic date * First half of C++20 changes * The other half of the /std:c++20 fixes * Fix link * Update cmake-projects-in-visual-studio.md * Remove duplicate line in build TOC * tech review * fixes * Cleanup per review * Update thread-class.md * Update future-functions.md * Update execution.md * Update execution.md * Update execution.md * Update future-functions.md * Update thread-class.md * Update execution.md * Update future-functions.md * Update thread-class.md * updates per tech review and other * added file_clock * Update execution.md * Update future-functions.md * Update thread-class.md * add gps_clock * update metadata * PR review edit, relative links * PR review edit, relative links * PR review edit, relative link * Fixed typo in bit-functions.md * Further typo fix * finished draft for local_t * acrolinx * Fixed broken links * incorp tech review * update typedef sections * add all related typedefs * fix tables * acrolinx * cleanup * fix links * fix tables * more table cleanup * another fix for tables. error msgs aren't by the error but I think I finally found the issue * one more table fix * typos * typo in code example * Update links to ARM docs (#3735) * Update links to ARM docs * Acrolinx and formatting pass * Acrolinx * Fix locale_t -> _locale_t * Update output-file-stream-member-functions.md Updated some code escapes for localization * Address github issues (MicrosoftDocs#3737) * fix github 3268 code example for Context::Yield() * fixed github #3312 - MFC CWnd::OnMouseHWheel description * Fix for github #3259-clarify change in the UI * acrolinx Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> * Update how-to-convert-standard-string-to-system-string.md Fixing example. ------- cc: @TylerMSFT GitHub Issue: https://github.com/MicrosoftDocs/cpp-docs/issues/2438 * 16.11 Add /Zc:char8_t compiler option * PR review edit, date * Typo: B::f instead of B::F * Add u8 C++20 changes * Add io.h header into example code Repro: 1. Paste sample code for _get_errno is placed into new Visual Studio 2019 project 1. Try to compile Result: Compilation fails The error is: Error C3861 '_sopen_s': identifier not found Expected Result: Sample code should just compile Fix: Add io.h header file to avoid the above error in sample code. * Address 3340 Static member access in example * add Git screenshots and Git text * edit Git text and screenshot locale info * fix Version Control link error * move new Git content to the right moniker section * Remove unneeded share.h from sample code in errno documentation * Update docs/get-started/tutorial-console-cpp.md Co-authored-by: Colin Robertson <corob@microsoft.com> Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: opbld15 <opbld15@microsoft.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: opbld17 <opbld17@microsoft.com> Co-authored-by: ystamant <49958001+ystamant@users.noreply.github.com> Co-authored-by: opbld16 <opbld16@microsoft.com> Co-authored-by: Andrew Shymanel <88244804+ainrd@users.noreply.github.com> Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com> Co-authored-by: PRMerger6 <prmrgr6@microsoft.com> Co-authored-by: PRMerger12 <prmrgr12@microsoft.com> Co-authored-by: PRMerger14 <prmrgr14@microsoft.com> Co-authored-by: PRMerger16 <prmrgr16@microsoft.com> Co-authored-by: PRMerger15 <prmrgr15@microsoft.com> Co-authored-by: PRMerger7 <prmrgr7@microsoft.com> Co-authored-by: PRMerger10 <prmrgr10@microsoft.com> Co-authored-by: David Dyck <david.dyck@gmail.com> Co-authored-by: Kristine Toliver <ktoliver@users.noreply.github.com> Co-authored-by: Steve Wishnousky <stwish@microsoft.com> Co-authored-by: Sam Freed <sfreed141@gmail.com> Co-authored-by: Don Spencer <87099566+v-donspencer@users.noreply.github.com> Co-authored-by: Beau Braig <86677107+BeauBraig@users.noreply.github.com> Co-authored-by: Alex Guteniev <gutenev@gmail.com> Co-authored-by: Paula Miller <v-paulmi@microsoft.com> Co-authored-by: RibShark <1957489+RibShark@users.noreply.github.com> Co-authored-by: onihusube <44743040+onihusube@users.noreply.github.com> Co-authored-by: PRMerger8 <prmrgr8@microsoft.com> Co-authored-by: Chris Ho <sudoerchris.ho@pm.me> Co-authored-by: Andrew Rogers <andrew.rogers@wdc.com> Co-authored-by: Sauparna Palchowdhury <91951+sauparna@users.noreply.github.com> Co-authored-by: Nikolai Aristov <43590492+NikoAri@users.noreply.github.com> Co-authored-by: Terry G. Lee <terry.g.lee@microsoft.com> Co-authored-by: PRMerger20 <prmrgr20@microsoft.com> Co-authored-by: Andrea Courtright <74212614+v-andreaco@users.noreply.github.com>
1 parent 1fa1d1e commit 9648b3b

File tree

12 files changed

+211
-77
lines changed

12 files changed

+211
-77
lines changed

docs/build/reference/zc-char8-t.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description: "Learn more about the /Zc:char8_t (Enable C++20 char8_t type) compiler option."
3+
title: "/Zc:char8_t (Enable C++20 char8_t type)"
4+
ms.date: 08/11/2021
5+
f1_keywords: ["/Zc:char8_t"]
6+
helpviewer_keywords: ["-Zc:char8_t compiler option (C++)", "/Zc:char8_t compiler option (C++)"]
7+
---
8+
# `/Zc:char8_t` (Enable C++20 char8_t type)
9+
10+
The **`/Zc:char8_t`** compiler option enables C++20 conforming **`char8_t`** type support. **`char8_t`** is a character type that's used to represent UTF-8 code units.
11+
12+
## Syntax
13+
14+
> **`/Zc:char8_t`**[**`-`**]
15+
16+
## Remarks
17+
18+
The **`/Zc:char8_t`** compiler option enables the **`char8_t`** type keyword as specified in the C++20 standard. It causes the compiler to generate `u8` prefixed character or string literals as `const char8_t` or `const char8_t[N]` types, respectively, instead of as `const char` or `const char[N]` types. In C++17, arrays of **`char`** may be initialized using `u8` string literals. In C++20, this initialization is ill-formed, and causes compiler error [C2440](../../error-messages/compiler-errors-1/compiler-error-c2440.md). This behavior can be a source-breaking change. You can revert the compiler to C++14 or C++17 behavior explicitly by specifying **`/Zc:char8_t-`**.
19+
20+
The **`/Zc:char8_t`** option is available starting in Visual Studio 2019 version 16.1. It's enabled automatically when you specify [`/std:c++20`](std-specify-language-standard-version.md) or later (such as **`/std:c++latest`**). Otherwise, it's off by default.
21+
22+
### Example
23+
24+
```cpp
25+
const char* s = u8"Hello"; // Compiles in C++17, Error C2440 in C++20
26+
const char8_t* s = u8"Hello"; // Compiles in C++20 or with /Zc:char8_t
27+
```
28+
29+
### To set this compiler option in Visual Studio
30+
31+
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
32+
33+
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
34+
35+
1. Add **`/Zc:char8_t`** or **`/Zc:char8_t-`** to the **Additional options:** pane.
36+
37+
## See also
38+
39+
[`/Zc` (Conformance)](zc-conformance.md)\
40+
[`/std` (Specify language standard version)](std-specify-language-standard-version.md)

docs/build/reference/zc-conformance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Here are the **`/Zc`** compiler options:
2424
|--|--|
2525
| [`/Zc:alignedNew`](zc-alignednew.md) | Enable C++17 over-aligned dynamic allocation (on by default in C++17). |
2626
| [`/Zc:auto`](zc-auto-deduce-variable-type.md) | Enforce the new Standard C++ meaning for **`auto`** (on by default). |
27+
| [`/Zc:char8_t`](zc-char8-t.md) | Enable or disable C++20 native `u8` literal support as `const char8_t` (off by default, except under **`/std:c++20`**). |
2728
| [`/Zc:__cplusplus`](zc-cplusplus.md) | Enable the `__cplusplus` macro to report the supported standard (off by default). |
2829
| [`/Zc:externConstexpr`](zc-externconstexpr.md) | Enable external linkage for **`constexpr`** variables (off by default). |
2930
| [`/Zc:forScope`](zc-forscope-force-conformance-in-for-loop-scope.md) | Enforce Standard C++ **`for`** scoping rules (on by default). |

docs/build/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@
761761
href: ../build/reference/zc-alignednew.md
762762
- name: "/Zc:auto (Deduce variable type)"
763763
href: ../build/reference/zc-auto-deduce-variable-type.md
764+
- name: "/Zc:char8_t (Enable C++20 char8_t type)"
765+
href: ../build/reference/zc-char8-t.md
764766
- name: "/Zc:__cplusplus (Enable updated __cplusplus macro)"
765767
href: ../build/reference/zc-cplusplus.md
766768
- name: "/Zc:externConstexpr (Enable extern constexpr variables)"

docs/c-runtime-library/reference/get-errno.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ By default, this function's global state is scoped to the application. To change
4141

4242
```C
4343
// crt_get_errno.c
44-
#include <stdio.h>
44+
#include <errno.h>
4545
#include <fcntl.h>
46+
#include <io.h>
47+
#include <stdio.h>
4648
#include <sys/stat.h>
47-
#include <share.h>
48-
#include <errno.h>
4949

5050
int main()
5151
{
5252
errno_t err;
5353
int pfh;
54-
_sopen_s( &pfh, "nonexistent.file", _O_WRONLY, _SH_DENYNO, _S_IWRITE );
55-
_get_errno( &err );
56-
printf( "errno = %d\n", err );
57-
printf( "fyi, ENOENT = %d\n", ENOENT );
54+
_sopen_s(&pfh, "nonexistent.file", _O_WRONLY, _SH_DENYNO, _S_IWRITE);
55+
_get_errno(&err);
56+
printf("errno = %d\n", err);
57+
printf("fyi, ENOENT = %d\n", ENOENT);
5858
}
5959
```
6060

docs/cpp/member-access-control-cpp.md

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
description: "Learn more about: Member Access Control (C++)"
33
title: "Member Access Control (C++)"
4-
ms.date: "11/19/2018"
4+
ms.date: 08/31/2021
55
helpviewer_keywords: ["access control [C++]", "member access [C++]", "member-access control [C++]"]
6+
no-loc: ["public", "private", "protected"]
67
ms.assetid: 2d596bca-56ad-4277-94e1-ce3db45fa14a
78
---
89
# Member Access Control (C++)
910

10-
Access controls enable you to separate the [public](../cpp/public-cpp.md) interface of a class from the [private](../cpp/private-cpp.md) implementation details and the [protected](../cpp/protected-cpp.md) members that are only for use by derived classes. The access specifier applies to all members declared after it until the next access specifier is encountered.
11+
Access controls enable you to separate the [`public`](../cpp/public-cpp.md) interface of a class from the [`private`](../cpp/private-cpp.md) implementation details and the [`protected`](../cpp/protected-cpp.md) members that are only for use by derived classes. The access specifier applies to all members declared after it until the next access specifier is encountered.
1112

1213
```cpp
1314
class Point
@@ -27,17 +28,17 @@ protected: // Declare protected function for derived classes only.
2728
};
2829
```
2930

30-
The default access is **`private`** in a class, and **`public`** in a struct or union. Access specifiers in a class can be used any number of times in any order. The allocation of storage for objects of class types is implementation dependent, but members are guaranteed to be assigned successively higher memory addresses between access specifiers.
31+
The default access is **`private`** in a class, and **`public`** in a struct or union. Access specifiers in a class can be used any number of times in any order. The allocation of storage for objects of class types is implementation-dependent. However, compilers must guarantee assignment of members to successively higher memory addresses between access specifiers.
3132

3233
## Member-Access Control
3334

3435
|Type of Access|Meaning|
3536
|--------------------|-------------|
36-
|[private](../cpp/private-cpp.md)|Class members declared as **`private`** can be used only by member functions and friends (classes or functions) of the class.|
37-
|[protected](../cpp/protected-cpp.md)|Class members declared as **`protected`** can be used by member functions and friends (classes or functions) of the class. Additionally, they can be used by classes derived from the class.|
38-
|[public](../cpp/public-cpp.md)|Class members declared as **`public`** can be used by any function.|
37+
|[`private`](../cpp/private-cpp.md)|Class members declared as **`private`** can be used only by member functions and friends (classes or functions) of the class.|
38+
|[`protected`](../cpp/protected-cpp.md)|Class members declared as **`protected`** can be used by member functions and friends (classes or functions) of the class. Additionally, they can be used by classes derived from the class.|
39+
|[`public`](../cpp/public-cpp.md)|Class members declared as **`public`** can be used by any function.|
3940

40-
Access control helps prevent you from using objects in ways they were not intended to be used. This protection is lost when explicit type conversions (casts) are performed.
41+
Access control helps prevent you from using objects in ways they weren't intended to be used. This protection is lost when you make explicit type conversions (casts).
4142

4243
> [!NOTE]
4344
> Access control is equally applicable to all names: member functions, member data, nested classes, and enumerators.
@@ -54,13 +55,13 @@ The following table shows the interaction between these factors and how to deter
5455

5556
### Member Access in Base Class
5657

57-
|private|protected|Public|
58-
|-------------|---------------|------------|
59-
|Always inaccessible regardless of derivation access|Private in derived class if you use private derivation|Private in derived class if you use private derivation|
60-
||Protected in derived class if you use protected derivation|Protected in derived class if you use protected derivation|
61-
||Protected in derived class if you use public derivation|Public in derived class if you use public derivation|
58+
| **`private`** | **`protected`** | **`public`** |
59+
|--|--|--|
60+
| Always inaccessible with any derivation access | **`private`** in derived class if you use **`private`** derivation | **`private`** in derived class if you use **`private`** derivation |
61+
| | **`protected`** in derived class if you use **`protected`** derivation | **`protected`** in derived class if you use **`protected`** derivation |
62+
| | **`protected`** in derived class if you use **`public`** derivation | **`public`** in derived class if you use **`public`** derivation |
6263

63-
The following example illustrates this:
64+
The following example illustrates access derivation:
6465

6566
```cpp
6667
// access_specifiers_for_base_classes.cpp
@@ -104,11 +105,11 @@ int main()
104105
}
105106
```
106107

107-
In `DerivedClass1`, the member function `PublicFunc` is a public member and `ProtectedFunc` is a protected member because `BaseClass` is a public base class. `PrivateFunc` is private to `BaseClass`, and it is inaccessible to any derived classes.
108+
In `DerivedClass1`, the member function `PublicFunc` is a **`public`** member and `ProtectedFunc` is a **`protected`** member because `BaseClass` is a **`public`** base class. `PrivateFunc` is **`private`** to `BaseClass`, and it's inaccessible to any derived classes.
108109

109-
In `DerivedClass2`, the functions `PublicFunc` and `ProtectedFunc` are considered private members because `BaseClass` is a private base class. Again, `PrivateFunc` is private to `BaseClass`, and it is inaccessible to any derived classes.
110+
In `DerivedClass2`, the functions `PublicFunc` and `ProtectedFunc` are considered **`private`** members because `BaseClass` is a **`private`** base class. Again, `PrivateFunc` is **`private`** to `BaseClass`, and it's inaccessible to any derived classes.
110111

111-
You can declare a derived class without a base-class access specifier. In such a case, the derivation is considered private if the derived class declaration uses the **`class`** keyword. The derivation is considered public if the derived class declaration uses the **`struct`** keyword. For example, the following code:
112+
You can declare a derived class without a base-class access specifier. In such a case, the derivation is considered **`private`** if the derived class declaration uses the **`class`** keyword. The derivation is considered **`public`** if the derived class declaration uses the **`struct`** keyword. For example, the following code:
112113

113114
```cpp
114115
class Derived : Base
@@ -136,16 +137,16 @@ struct Derived : public Base
136137
...
137138
```
138139

139-
Note that members declared as having private access are not accessible to functions or derived classes unless those functions or classes are declared using the **`friend`** declaration in the base class.
140+
Members declared as having **`private`** access aren't accessible to functions or derived classes unless those functions or classes are declared using the **`friend`** declaration in the base class.
140141

141-
A **`union`** type cannot have a base class.
142+
A **`union`** type can't have a base class.
142143

143144
> [!NOTE]
144145
> When specifying a private base class, it is advisable to explicitly use the **`private`** keyword so users of the derived class understand the member access.
145146

146147
## Access control and static members
147148

148-
When you specify a base class as **`private`**, it affects only nonstatic members. Public static members are still accessible in the derived classes. However, accessing members of the base class using pointers, references, or objects can require a conversion, at which time access control is again applied. Consider the following example:
149+
When you specify a base class as **`private`**, it affects only nonstatic members. Public static members are still accessible in the derived classes. However, accessing members of the base class using pointers, references, or objects can require a conversion, which applies access control again. Consider the following example:
149150

150151
```cpp
151152
// access_control.cpp
@@ -160,34 +161,37 @@ public:
160161
class Derived1 : private Base
161162
{
162163
};
164+
163165
// Derived2 declares Derived1 as a public base class.
164166
class Derived2 : public Derived1
165167
{
166168
int ShowCount(); // Nonstatic member.
167169
};
170+
168171
// Define ShowCount function for Derived2.
169172
int Derived2::ShowCount()
170173
{
171-
// Call static member function CountOf explicitly.
172-
int cCount = Base::CountOf(); // OK.
173-
174-
// Call static member function CountOf using pointer.
175-
cCount = this->CountOf(); // C2247. Conversion of
176-
// Derived2 * to Base * not
177-
// permitted.
174+
// Call static member function CountOf explicitly.
175+
int cCount = ::Base::CountOf(); // OK.
176+
177+
// Call static member function CountOf using pointer.
178+
cCount = this->CountOf(); // C2247: 'Base::CountOf'
179+
// not accessible because
180+
// 'Derived1' uses 'private'
181+
// to inherit from 'Base'
178182
return cCount;
179183
}
180184
```
181185

182-
In the preceding code, access control prohibits conversion from a pointer to `Derived2` to a pointer to `Base`. The **`this`** pointer is implicitly of type `Derived2 *`. To select the `CountOf` function, **`this`** must be converted to type `Base *`. Such a conversion is not permitted because `Base` is a private indirect base class to `Derived2`. Conversion to a private base class type is acceptable only for pointers to immediate derived classes. Therefore, pointers of type `Derived1 *` can be converted to type `Base *`.
186+
In the preceding code, access control prohibits conversion from a pointer to `Derived2` to a pointer to `Base`. The **`this`** pointer is implicitly of type `Derived2 *`. To select the `CountOf` function, **`this`** must be converted to type `Base *`. Such a conversion isn't permitted because `Base` is a private indirect base class to `Derived2`. Conversion to a private base class type is acceptable only for pointers to immediate derived classes. That's why pointers of type `Derived1 *` can be converted to type `Base *`.
183187

184-
Note that calling the `CountOf` function explicitly, without using a pointer, reference, or object to select it, implies no conversion. Therefore, the call is allowed.
188+
An explicit call to the `CountOf` function, without using a pointer, reference, or object to select it, implies no conversion. That's why the call is allowed.
185189

186190
Members and friends of a derived class, `T`, can convert a pointer to `T` to a pointer to a private direct base class of `T`.
187191

188192
## Access to virtual functions
189193

190-
The access control applied to [virtual](../cpp/virtual-cpp.md) functions is determined by the type used to make the function call. Overriding declarations of the function do not affect the access control for a given type. For example:
194+
The access control applied to [`virtual`](../cpp/virtual-cpp.md) functions is determined by the type used to make the function call. Overriding declarations of the function don't affect the access control for a given type. For example:
191195

192196
```cpp
193197
// access_to_virtual_functions.cpp
@@ -217,10 +221,10 @@ int main()
217221
}
218222
```
219223

220-
In the preceding example, calling the virtual function `GetState` using a pointer to type `VFuncBase` calls `VFuncDerived::GetState`, and `GetState` is treated as public. However, calling `GetState` using a pointer to type `VFuncDerived` is an access-control violation because `GetState` is declared private in class `VFuncDerived`.
224+
In the preceding example, calling the virtual function `GetState` using a pointer to type `VFuncBase` calls `VFuncDerived::GetState`, and `GetState` is treated as **`public`**. However, calling `GetState` using a pointer to type `VFuncDerived` is an access-control violation because `GetState` is declared **`private`** in class `VFuncDerived`.
221225

222226
> [!CAUTION]
223-
> The virtual function `GetState` can be called using a pointer to the base class `VFuncBase`. This does not mean that the function called is the base-class version of that function.
227+
> The virtual function `GetState` can be called using a pointer to the base class `VFuncBase`. This doesn't mean that the function called is the base-class version of that function.
224228

225229
## Access control with multiple inheritance
226230

@@ -229,7 +233,7 @@ In multiple-inheritance lattices involving virtual base classes, a given name ca
229233
![Diagram showing access along the paths of an inheritance graph.](../cpp/media/vc38v91.gif "Access along paths of an inheritance graph") <br/>
230234
Access along paths of an inheritance graph
231235

232-
In the figure, a name declared in class `VBase` is always reached through class `RightPath`. The right path is more accessible because `RightPath` declares `VBase` as a public base class, whereas `LeftPath` declares `VBase` as private.
236+
In the figure, a name declared in class `VBase` is always reached through class `RightPath`. The right path is more accessible because `RightPath` declares `VBase` as a **`public`** base class, while `LeftPath` declares `VBase` as **`private`**.
233237

234238
## See also
235239

0 commit comments

Comments
 (0)