Skip to content

Commit 2da569b

Browse files
author
Colin Robertson
authored
Merge branch 'master' into mb-morelinks
2 parents 50da76a + 815a210 commit 2da569b

File tree

3 files changed

+44
-26
lines changed

3 files changed

+44
-26
lines changed

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

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,44 @@ protected: // Declare protected function for derived classes only.
6868

6969
```cpp
7070
// access_specifiers_for_base_classes.cpp
71-
class BaseClass
72-
{
73-
public:
74-
int PublicFunc(); // Declare a public member.
75-
protected:
76-
int ProtectedFunc(); // Declare a protected member.
77-
private:
78-
int PrivateFunc(); // Declare a private member.
79-
};
80-
71+
class BaseClass
72+
{
73+
public:
74+
int PublicFunc(); // Declare a public member.
75+
protected:
76+
int ProtectedFunc(); // Declare a protected member.
77+
private:
78+
int PrivateFunc(); // Declare a private member.
79+
};
80+
8181
// Declare two classes derived from BaseClass.
82-
class DerivedClass1 : public BaseClass
83-
{
84-
};
85-
86-
class DerivedClass2 : private BaseClass
87-
{
88-
};
89-
90-
int main()
91-
{
92-
}
82+
class DerivedClass1 : public BaseClass
83+
{
84+
void foo()
85+
{
86+
PublicFunc();
87+
ProtectedFunc();
88+
PrivateFunc(); // function is inaccessible
89+
}
90+
};
91+
92+
class DerivedClass2 : private BaseClass
93+
{
94+
void foo()
95+
{
96+
PublicFunc();
97+
ProtectedFunc();
98+
PrivateFunc(); // function is inaccessible
99+
}
100+
};
101+
102+
int main()
103+
{
104+
DerivedClass1 derived_class1;
105+
DerivedClass2 derived_class2;
106+
derived_class1.PublicFunc();
107+
derived_class2.PublicFunc(); // function is inaccessible
108+
}
93109
```
94110

95111
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.
@@ -216,5 +232,6 @@ Access Along Paths of an Inheritance Graph
216232

217233
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.
218234

219-
## See also
220-
[C++ Language Reference](../cpp/cpp-language-reference.md)
235+
236+
## See Also
237+
[C++ Language Reference](../cpp/cpp-language-reference.md)

docs/intrinsics/interlockeddecrement-intrinsic-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
1515
# _InterlockedDecrement Intrinsic Functions
1616
**Microsoft Specific**
1717

18-
Provides compiler intrinsic support for the Win32 Windows SDK [InterlockedDecrement](/windows/desktop/api/winbase/nf-winbase-interlockeddecrement) function.
18+
Provides compiler intrinsic support for the Win32 Windows SDK [InterlockedDecrement](/windows/desktop/api/winbase/nf-winbase-interlockeddecrement) function.
1919

2020
## Syntax
2121

docs/mfc/reference/cprogressctrl-class.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,12 @@ COLORREF SetBarColor(COLORREF clrBar);
303303
|[in] *clrBar*|A [COLORREF](http://msdn.microsoft.com/library/windows/desktop/dd183449) value that specifies the new color of the progress indicator bar. Specify CLR_DEFAULT to cause the progress bar to use its default color.|
304304

305305
### Return Value
306-
The previous color of the progress indicator bar, represented as a [COLORREF](http://msdn.microsoft.com/library/windows/desktop/dd183449) value, or CLR_DEFAULT if the color of the progress indicator bar is the default color.
306+
307+
The previous color of the progress indicator bar, represented as a [COLORREF](http://msdn.microsoft.com/library/windows/desktop/dd183449) value, or CLR_DEFAULT if the color of the progress indicator bar is the default color.
307308

308309
### Remarks
309310

310-
The `SetBarColor` method sets the progress bar color only if a Windows Vista [theme](/windows/desktop/Controls/visual-styles-overview) is not in effect.
311+
The `SetBarColor` method sets the progress bar color only if a Windows Vista [theme](/windows/desktop/Controls/visual-styles-overview) is not in effect.
311312

312313
This method sends the [PBM_SETBARCOLOR](http://msdn.microsoft.com/library/windows/desktop/bb760838) message, which is described in the Windows SDK.
313314

0 commit comments

Comments
 (0)