Skip to content

Commit 5149093

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent f1e8b15 commit 5149093

File tree

3 files changed

+80
-16
lines changed

3 files changed

+80
-16
lines changed

reference/concepts/derived_from.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
</head>
7070
<body>
71-
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;concepts&#34;], &#34;id-type&#34;: [&#34;concept&#34;], &#34;namespace&#34;: [&#34;std&#34;], &#34;cpp&#34;: [&#34;cpp20&#34;]}, &#34;sources&#34;: [{&#34;id&#34;: &#34;77c82ffc736c20feb3887ca84e26d4d72be45546&#34;, &#34;source&#34;: &#34;#include &lt;iostream&gt;\n#include &lt;concepts&gt;\n\ntemplate&lt;typename T, typename U&gt;\nrequires std::derived_from&lt;T, U&gt;\nvoid check_derived() {\n std::cout &lt;&lt; \&#34;U is base class of T\&#34; &lt;&lt; std::endl;\n}\n\ntemplate&lt;typename T, typename U&gt;\nvoid check_derived() {\n std::cout &lt;&lt; \&#34;U and T are others\&#34; &lt;&lt; std::endl;\n}\n\nstruct Base {};\n\n//public\u7d99\u627f\nstruct Derived1 : Base {};\n//private\nstruct Derived2 : private Base {};\n//protected\nstruct Derived3 : protected Base {};\n//\u66d6\u6627\u306a\u7d99\u627f\nstruct Derived4 : Base, Derived1 {};\n//\u4eee\u60f3\u7d99\u627f\nstruct Derived5 : virtual public Base {};\nstruct Derived6 : virtual public Base {};\nstruct Derived7 : Derived5, Derived6 {};\n//\u7d99\u627f\u306e\u7d99\u627f\nstruct Derived8 : Derived1 {};\n\nint main()\n{\n check_derived&lt;int, int&gt;();\n check_derived&lt;Base, const Base&gt;();\n check_derived&lt;Derived1, Base&gt;();\n check_derived&lt;Derived2, Base&gt;();\n check_derived&lt;Derived3, Base&gt;();\n check_derived&lt;Derived4, Base&gt;();\n check_derived&lt;Derived5, Base&gt;();\n check_derived&lt;Derived7, Base&gt;();\n check_derived&lt;Derived8, Base&gt;();\n}\n&#34;}], &#34;page_id&#34;: [&#34;reference&#34;, &#34;concepts&#34;, &#34;derived_from&#34;]}">
71+
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;concepts&#34;], &#34;id-type&#34;: [&#34;concept&#34;], &#34;namespace&#34;: [&#34;std&#34;], &#34;cpp&#34;: [&#34;cpp20&#34;]}, &#34;sources&#34;: [{&#34;id&#34;: &#34;0c22f27a1f1f2c2325f7f34c536b793b04f79f08&#34;, &#34;source&#34;: &#34;#include &lt;iostream&gt;\n#include &lt;concepts&gt;\n\ntemplate&lt;typename T, typename U&gt;\nrequires std::derived_from&lt;T, U&gt;\nvoid check_derived() {\n std::cout &lt;&lt; \&#34;U is base class of T\&#34; &lt;&lt; std::endl;\n}\n\ntemplate&lt;typename T, typename U&gt;\nvoid check_derived() {\n std::cout &lt;&lt; \&#34;U is not base class of T\&#34; &lt;&lt; std::endl;\n}\n\nstruct Base {};\n\n//public\u7d99\u627f\nstruct Derived1 : Base {};\n//private\u7d99\u627f\nstruct Derived2 : private Base {};\n//protected\u7d99\u627f\nstruct Derived3 : protected Base {};\n//\u66d6\u6627\u306a\u7d99\u627f\nstruct Derived4 : Base, Derived1 {};\n//\u4eee\u60f3\u7d99\u627f\nstruct Derived5 : virtual public Base {};\nstruct Derived6 : virtual public Base {};\nstruct Derived7 : Derived5, Derived6 {};\n//\u7d99\u627f\u306e\u7d99\u627f\nstruct Derived8 : Derived1 {};\n\nint main()\n{\n check_derived&lt;int, int&gt;();\n check_derived&lt;Base, const Base&gt;();\n check_derived&lt;Derived1, Base&gt;();\n check_derived&lt;Derived2, Base&gt;();\n check_derived&lt;Derived3, Base&gt;();\n check_derived&lt;Derived4, Base&gt;();\n check_derived&lt;Derived5, Base&gt;();\n check_derived&lt;Derived7, Base&gt;();\n check_derived&lt;Derived8, Base&gt;();\n}\n&#34;}], &#34;page_id&#34;: [&#34;reference&#34;, &#34;concepts&#34;, &#34;derived_from&#34;]}">
7272
<nav class="navbar navbar-default" role="navigation">
7373
<div class="container-fluid">
7474
<div class="navbar-header">
@@ -188,12 +188,12 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2024-06-11T13:45:38">
192-
2024年06月11日 13時45分38秒
191+
<span itemprop="datePublished" content="2025-07-08T13:32:19">
192+
2025年07月08日 13時32分19秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
196-
<span itemprop="name">Akira Takahashi</span>
196+
<span itemprop="name">suomesta</span>
197197
</span>
198198
が更新
199199
</small></p>
@@ -229,9 +229,9 @@ <h2>備考</h2>
229229
<li><code>Base</code><code>Derived</code>の曖昧ではない<code>public</code>継承されたクラスである</li>
230230
<li><code>Base</code><code>Derived</code><a class="cpprefjp-defined-word" data-desc="型をconstおよび・もしくはvolatileで修飾すること">CV修飾</a>の違いを除いて同じクラス型である</li>
231231
</ul>
232-
<p><code>Derived</code><code>Base</code>を公開継承しない場合、<code><a href="../type_traits/is_base_of.html">std::is_base_of&lt;Derived, Base&gt;</a></code>の判定とは異なる結果となる。</p>
232+
<p><code>Derived</code><code>Base</code>を公開継承しない場合、<code><a href="../type_traits/is_base_of.html">std::is_base_of&lt;Base, Derived&gt;</a></code>の判定とは異なる結果となる。</p>
233233
<h2></h2>
234-
<p><div class="yata" id="77c82ffc736c20feb3887ca84e26d4d72be45546"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../iostream.html">&lt;iostream&gt;</a></span><span class="cp"></span>
234+
<p><div class="yata" id="0c22f27a1f1f2c2325f7f34c536b793b04f79f08"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../iostream.html">&lt;iostream&gt;</a></span><span class="cp"></span>
235235
<span class="cp">#include</span> <span class="cpf"><a href="../concepts.html">&lt;concepts&gt;</a></span><span class="cp"></span>
236236

237237
<span class="k">template</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">T</span><span class="p">,</span> <span class="k">typename</span> <span class="n">U</span><span class="o">&gt;</span>
@@ -242,16 +242,16 @@ <h2>例</h2>
242242

243243
<span class="k">template</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">T</span><span class="p">,</span> <span class="k">typename</span> <span class="n">U</span><span class="o">&gt;</span>
244244
<span class="kt">void</span> <span class="n">check_derived</span><span class="p">()</span> <span class="p">{</span>
245-
<span class="n"><a href="../iostream/cout.html">std::cout</a></span> <span class="o">&lt;&lt;</span> <span class="s">"U and T are others"</span> <span class="o">&lt;&lt;</span> <span class="n"><a href="../ostream/endl.html">std::endl</a></span><span class="p">;</span>
245+
<span class="n"><a href="../iostream/cout.html">std::cout</a></span> <span class="o">&lt;&lt;</span> <span class="s">"U is not base class of T"</span> <span class="o">&lt;&lt;</span> <span class="n"><a href="../ostream/endl.html">std::endl</a></span><span class="p">;</span>
246246
<span class="p">}</span>
247247

248248
<span class="k">struct</span> <span class="n">Base</span> <span class="p">{};</span>
249249

250250
<span class="c1">//public継承</span>
251251
<span class="k">struct</span> <span class="nl">Derived1</span> <span class="p">:</span> <span class="n">Base</span> <span class="p">{};</span>
252-
<span class="c1">//private</span>
252+
<span class="c1">//private継承</span>
253253
<span class="k">struct</span> <span class="nl">Derived2</span> <span class="p">:</span> <span class="k">private</span> <span class="n">Base</span> <span class="p">{};</span>
254-
<span class="c1">//protected</span>
254+
<span class="c1">//protected継承</span>
255255
<span class="k">struct</span> <span class="nl">Derived3</span> <span class="p">:</span> <span class="k">protected</span> <span class="n">Base</span> <span class="p">{};</span>
256256
<span class="c1">//曖昧な継承</span>
257257
<span class="k">struct</span> <span class="nl">Derived4</span> <span class="p">:</span> <span class="n">Base</span><span class="p">,</span> <span class="n">Derived1</span> <span class="p">{};</span>
@@ -277,12 +277,12 @@ <h2>例</h2>
277277
</code></pre></div>
278278
</div></p>
279279
<h3>出力</h3>
280-
<p><pre><code>U and T are others
280+
<p><pre><code>U is not base class of T
281281
U is base class of T
282282
U is base class of T
283-
U and T are others
284-
U and T are others
285-
U and T are others
283+
U is not base class of T
284+
U is not base class of T
285+
U is not base class of T
286286
U is base class of T
287287
U is base class of T
288288
U is base class of T

rss.xml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,74 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<link href="https://cpprefjp.github.io" />
5-
<updated>2025-07-08T12:01:29.490728</updated>
6-
<id>9eb567fa-20f6-4412-afd5-5daed6b502f2</id>
5+
<updated>2025-07-08T13:36:47.897782</updated>
6+
<id>4ea53472-a487-4a5f-a3fd-53f09d8bc0ed</id>
77

88

9+
<entry>
10+
<title>derived_from -- improve std::derived_from</title>
11+
<link href="https://cpprefjp.github.io/reference/concepts/derived_from.html"/>
12+
<id>3f31163a0b1c6633b1c6940c4493066da0f339bc:reference/concepts/derived_from.md</id>
13+
<updated>2025-07-08T22:32:19+09:00</updated>
14+
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/concepts/derived_from.md b/reference/concepts/derived_from.md
16+
index 869a70edd..2951ef9a9 100644
17+
--- a/reference/concepts/derived_from.md
18+
+++ b/reference/concepts/derived_from.md
19+
@@ -27,7 +27,7 @@ namespace std {
20+
- `Base`は`Derived`の曖昧ではない`public`継承されたクラスである
21+
- `Base`と`Derived`はCV修飾の違いを除いて同じクラス型である
22+
23+
-`Derived`が`Base`を公開継承しない場合、[`std::is_base_of&amp;lt;Derived, Base&amp;gt;`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
24+
+`Derived`が`Base`を公開継承しない場合、[`std::is_base_of&amp;lt;Base, Derived&amp;gt;`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
25+
26+
## 例
27+
```cpp example
28+
@@ -42,16 +42,16 @@ void check_derived() {
29+
30+
template&amp;lt;typename T, typename U&amp;gt;
31+
void check_derived() {
32+
- std::cout &amp;lt;&amp;lt; &amp;#34;U and T are others&amp;#34; &amp;lt;&amp;lt; std::endl;
33+
+ std::cout &amp;lt;&amp;lt; &amp;#34;U is not base class of T&amp;#34; &amp;lt;&amp;lt; std::endl;
34+
}
35+
36+
struct Base {};
37+
38+
//public継承
39+
struct Derived1 : Base {};
40+
-//private
41+
+//private継承
42+
struct Derived2 : private Base {};
43+
-//protected
44+
+//protected継承
45+
struct Derived3 : protected Base {};
46+
//曖昧な継承
47+
struct Derived4 : Base, Derived1 {};
48+
@@ -79,12 +79,12 @@ int main()
49+
50+
### 出力
51+
```
52+
-U and T are others
53+
+U is not base class of T
54+
U is base class of T
55+
U is base class of T
56+
-U and T are others
57+
-U and T are others
58+
-U and T are others
59+
+U is not base class of T
60+
+U is not base class of T
61+
+U is not base class of T
62+
U is base class of T
63+
U is base class of T
64+
U is base class of T
65+
&lt;/code&gt;&lt;/pre&gt;</summary>
66+
67+
<author>
68+
<name>suomesta</name>
69+
<email>[email protected]</email>
70+
</author>
71+
</entry>
72+
973
<entry>
1074
<title>realloc -- update</title>
1175
<link href="https://cpprefjp.github.io/reference/cstdlib/realloc.html"/>

sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12554,7 +12554,7 @@
1255412554

1255512555
<url>
1255612556
<loc>https://cpprefjp.github.io/reference/concepts/derived_from.html</loc>
12557-
<lastmod>2025-07-07T17:11:12+09:00</lastmod>
12557+
<lastmod>2025-07-08T22:32:19+09:00</lastmod>
1255812558
<changefreq>daily</changefreq>
1255912559
<priority>0.7</priority>
1256012560
</url>

0 commit comments

Comments
 (0)