Files
hustoj/web/cppreference-zh/chmhelp/cpp-ranges-transform_view-iterator-operator_at.html
2025-08-01 12:57:54 +08:00

60 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
<head><meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>std::ranges::transform_view&lt;V,F&gt;::iterator&lt;Const&gt;::operator[]</title>
<link rel="stylesheet" href="ext.css" />
<link rel="stylesheet" href="site_modules.css" />
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_ranges_transform_view_iterator_operator_at skin-cppreference2 action-view cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::ranges::transform_view&lt;V,F&gt;::<i>iterator</i>&lt;Const&gt;::</span>operator[]</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-ranges.html">ranges</a>&lrm; | <a href="cpp-ranges-transform_view.html">transform view</a>&lrm; | <a href="cpp-ranges-transform_view-iterator.html">iterator</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<table class="t-dcl-begin">
<tbody>
<tr class="t-dcl t-since-cxx20">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="br0">[</span><span class="br0">]</span><span class="br0">(</span> difference_type n <span class="br0">)</span> <span class="kw4">const</span><br />
&nbsp; requires ranges<span class="sy4">::</span><span class="me2">random_access_range</span><span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-since-cxx20">(C++20 &#36215;)</span></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#36820;&#22238;&#21464;&#25442;&#21518;&#30340;&#20301;&#20110;&#30456;&#23545;&#20301;&#32622;&#30340;&#20803;&#32032;&#12290;</p>
<p>&#31561;&#25928;&#20110;&#36820;&#22238; <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="cpp-utility-functional-invoke.html"><span class="kw1058">std::<span class="me2">invoke</span></span></a><span class="br0">(</span><span class="sy2">*</span>parent_<span class="sy2">-</span><span class="sy1">&gt;</span>fun_, current_<span class="br0">[</span>n<span class="br0">]</span><span class="br0">)</span></span></span> &#65292;&#20854;&#20013; <code>*parent_-&gt;fun_</code> &#26159;&#23384;&#20648;&#20110;&#20146; <code>transform_view</code> &#30340;&#21464;&#25442;&#20989;&#25968;&#65292;&#32780; <code>current_</code> &#26159;&#25351;&#21521; <code>V</code> &#20013;&#30340;&#24213;&#23618;&#36845;&#20195;&#22120;&#12290;</p>
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">&#21442;&#25968;</span></h3>
<table class="t-par-begin">
<tr class="t-par">
<td>n</td>
<td>-</td>
<td>&#30456;&#23545;&#20110;&#24403;&#21069;&#20301;&#32622;&#30340;&#20301;&#32622;&#12290;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E8.BF.94.E5.9B.9E.E5.80.BC">&#36820;&#22238;&#20540;</span></h3>
<p>&#21464;&#25442;&#21518;&#30340;&#20803;&#32032;</p>
<h3><span class="mw-headline" id=".E7.A4.BA.E4.BE.8B">&#31034;&#20363;</span></h3>
<table class="metadata plainlinks ambox mbox-small-left ambox-notice" style="">
<tr>
<td class="mbox-empty-cell"></td>
<td class="mbox-text" style="">&#26412;&#33410;&#26410;&#23436;&#25104;<br />
&#21407;&#22240;&#65306;&#26242;&#26080;&#31034;&#20363;</td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>