File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ namespace std {
2727- `Base`は`Derived`の曖昧ではない`public`継承されたクラスである
2828- `Base`と`Derived`はCV修飾の違いを除いて同じクラス型である
2929
30- `Derived`が`Base`を公開継承しない場合、[`std::is_base_of<Derived, Base >`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
30+ `Derived`が`Base`を公開継承しない場合、[`std::is_base_of<Base, Derived >`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
3131
3232## 例
3333```cpp example
@@ -42,16 +42,16 @@ void check_derived() {
4242
4343template<typename T, typename U>
4444void check_derived() {
45- std::cout << "U and T are others " << std::endl;
45+ std::cout << "U is not base class of T " << std::endl;
4646}
4747
4848struct Base {};
4949
5050//public継承
5151struct Derived1 : Base {};
52- //private
52+ //private継承
5353struct Derived2 : private Base {};
54- //protected
54+ //protected継承
5555struct Derived3 : protected Base {};
5656//曖昧な継承
5757struct Derived4 : Base, Derived1 {};
@@ -79,12 +79,12 @@ int main()
7979
8080### 出力
8181```
82- U and T are others
82+ U is not base class of T
8383U is base class of T
8484U is base class of T
85- U and T are others
86- U and T are others
87- U and T are others
85+ U is not base class of T
86+ U is not base class of T
87+ U is not base class of T
8888U is base class of T
8989U is base class of T
9090U is base class of T
You can’t perform that action at this time.
0 commit comments