50 lines
4.3 KiB
HTML
50 lines
4.3 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>C++ 具名要求:常量表达式迭代器 (ConstexprIterator)</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_named_req_ConstexprIterator 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%">C++ 具名要求:</span><span style="font-style:italic">常量表达式迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(ConstexprIterator)</span></h1>
|
|
<div id="bodyContent">
|
|
<div id="contentSub"><span class="subpages">< <a href="cpp.html">cpp</a>‎ | <a href="cpp-named_req.html">named req</a></span></div>
|
|
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
|
|
<p><span style="font-style:italic">常量表达式迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(ConstexprIterator)</span> 是能在常量表达式求值中使用的<a href="cpp-named_req-Iterator.html"><span style="font-style:italic">老式迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(LegacyIterator)</span></a> 。</p>
|
|
<h3><span class="mw-headline" id=".E8.A6.81.E6.B1.82">要求</span></h3>
|
|
<p>若符合下列条件,则类型 <code>It</code> 满足<span style="font-style:italic">常量表达式迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(ConstexprIterator)</span></p>
|
|
<ul>
|
|
<li>类型 <code>It</code> 满足某个迭代器具名要求 <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">MeowIterator</span></li>
|
|
</ul>
|
|
<p>而对于每个</p>
|
|
<ul>
|
|
<li><code>purr</code>,为 <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">MeowIterator</span> 在 <code>It</code> 上要求支持的操作,</li>
|
|
<li><code>kittens...</code>,为一组 <code>purr</code> 的实参,满足该操作的要求,</li>
|
|
</ul>
|
|
<p>则</p>
|
|
<ul>
|
|
<li>若 <code>kittens...</code> 可用于常量表达式,则 <code>purr(kittens...)</code> 亦然</li>
|
|
</ul>
|
|
<h3><span class="mw-headline" id=".E6.A0.87.E5.87.86.E5.BA.93">标准库</span></h3>
|
|
<p>下列标准库类型是<span style="font-style:italic">常量表达式迭代器</span> <span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">(ConstexprIterator)</span> :</p>
|
|
<ul>
|
|
<li><a href="cpp-container-array.html"><tt>array::iterator</tt></a> 及 <a href="cpp-container-array.html"><tt>array::const_iterator</tt></a>。</li>
|
|
<li><a href="cpp-string-basic_string_view.html"><tt>basic_string_view::iterator</tt></a>。</li>
|
|
<li><a href="cpp-container-span.html"><tt>span::iterator</tt></a>。</li>
|
|
<li><a href="cpp-container-vector.html"><tt>vector::iterator</tt></a> 及 <a href="cpp-container-vector.html"><tt>vector::const_iterator</tt></a>。</li>
|
|
</ul>
|
|
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
|
|
<ul>
|
|
<li><a href="cpp-iterator.html">迭代器库</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|