|
68 | 68 |
|
69 | 69 | </head>
|
70 | 70 | <body>
|
71 |
| -<header data-kunai-mdinfo="{"meta": {"header": ["algorithm"], "namespace": ["std::ranges"], "id-type": ["function template"], "cpp": ["cpp20"]}, "sources": [{"id": "5d857bc01d42fa4103227a84ca17f9c615b15e84", "source": "#include <algorithm>\n#include <iostream>\n#include <array>\n\nint main() {\n constexpr std::array v = { 3, 1, 4 };\n constexpr auto result = std::ranges::find(v, 1);\n if (result == v.end()) {\n std::cout << \"not found\" << std::endl;\n } else {\n std::cout << \"found: \" << *result << std::endl;\n }\n}\n"}], "page_id": ["reference", "algorithm", "ranges_find"]}"> |
| 71 | +<header data-kunai-mdinfo="{"meta": {"header": ["algorithm"], "namespace": ["std::ranges"], "id-type": ["function template"], "cpp": ["cpp20"]}, "sources": [{"id": "93f0b158e0bb885b2dcfb93a4373d7c615ca081f", "source": "#include <algorithm>\n#include <iostream>\n#include <array>\n\nint main() {\n constexpr std::array v = { 3, 1, 4 };\n const auto result = std::ranges::find(v, 1);\n if (result == v.end()) {\n std::cout << \"not found\" << std::endl;\n } else {\n std::cout << \"found: \" << *result << std::endl;\n }\n}\n"}], "page_id": ["reference", "algorithm", "ranges_find"]}"> |
72 | 72 | <nav class="navbar navbar-default" role="navigation">
|
73 | 73 | <div class="container-fluid">
|
74 | 74 | <div class="navbar-header">
|
|
188 | 188 |
|
189 | 189 | <p class="text-right"><small>
|
190 | 190 | 最終更新日時(UTC):
|
191 |
| - <span itemprop="datePublished" content="2024-06-11T13:45:38"> |
192 |
| - 2024年06月11日 13時45分38秒 |
| 191 | + <span itemprop="datePublished" content="2024-07-07T06:36:42"> |
| 192 | + 2024年07月07日 06時36分42秒 |
193 | 193 | </span>
|
194 | 194 | <br/>
|
195 | 195 | <span itemprop="author" itemscope itemtype="http://schema.org/Person">
|
196 |
| - <span itemprop="name">Akira Takahashi</span> |
| 196 | + <span itemprop="name">suomesta</span> |
197 | 197 | </span>
|
198 | 198 | が更新
|
199 | 199 | </small></p>
|
@@ -247,13 +247,13 @@ <h2>戻り値</h2>
|
247 | 247 | <h2>計算量</h2>
|
248 | 248 | <p>最大で <code>last - first</code> 回比較を行う</p>
|
249 | 249 | <h2>例</h2>
|
250 |
| -<p><div class="yata" id="5d857bc01d42fa4103227a84ca17f9c615b15e84"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../algorithm.html"><algorithm></a></span><span class="cp"></span> |
| 250 | +<p><div class="yata" id="93f0b158e0bb885b2dcfb93a4373d7c615ca081f"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../algorithm.html"><algorithm></a></span><span class="cp"></span> |
251 | 251 | <span class="cp">#include</span> <span class="cpf"><a href="../iostream.html"><iostream></a></span><span class="cp"></span>
|
252 | 252 | <span class="cp">#include</span> <span class="cpf"><a href="../array.html"><array></a></span><span class="cp"></span>
|
253 | 253 |
|
254 | 254 | <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
|
255 | 255 | <span class="k">constexpr</span> <span class="n"><a href="../array/array.html">std::array</a></span> <span class="n">v</span> <span class="o">=</span> <span class="p">{</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">4</span> <span class="p">};</span>
|
256 |
| - <span class="k">constexpr</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n"><span style="color:#ff0000">std::ranges::find</span></span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span> |
| 256 | + <span class="k">const</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n"><span style="color:#ff0000">std::ranges::find</span></span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span> |
257 | 257 | <span class="k">if</span> <span class="p">(</span><span class="n">result</span> <span class="o">==</span> <span class="n"><a href="../vector/vector/end.html">v.end()</a></span><span class="p">)</span> <span class="p">{</span>
|
258 | 258 | <span class="n"><a href="../iostream/cout.html">std::cout</a></span> <span class="o"><<</span> <span class="s">"not found"</span> <span class="o"><<</span> <span class="n"><a href="../ostream/endl.html">std::endl</a></span><span class="p">;</span>
|
259 | 259 | <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
|
0 commit comments