上传cppreference

This commit is contained in:
2025-08-01 12:57:54 +08:00
parent e29892f8cd
commit 196e706fe4
5485 changed files with 982007 additions and 3 deletions

View File

@@ -0,0 +1,98 @@
<!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>operator&lt;&lt;,&gt;&gt;(std::uniform_int_distribution)</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_numeric_random_uniform_int_distribution_operator_ltltgtgt skin-cppreference2 action-view cpp-page-template cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading">operator&lt;&lt;,&gt;&gt;<small>(std::uniform_int_distribution)</small></h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-numeric.html">numeric</a>&lrm; | <a href="cpp-numeric-random.html">random</a>&lrm; | <a href="cpp-numeric-random-uniform_int_distribution.html">uniform int distribution</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<div class="t-page-template" style="">
<p></p>
</div>
<table class="t-dcl-begin">
<tbody>
<tr class="t-dcl t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> CharT, <span class="kw1">class</span> Traits <span class="sy1">&gt;</span><br /></span>
<p><span class="kw1">friend</span> <a href="cpp-io-basic_ostream.html"><span class="kw1715">std::<span class="me2">basic_ostream</span></span></a><span class="sy1">&lt;</span>CharT,Traits<span class="sy1">&gt;</span><span class="sy3">&amp;</span><br />
&nbsp; &nbsp; operator<span class="sy1">&lt;&lt;</span><span class="br0">(</span> <a href="cpp-io-basic_ostream.html"><span class="kw1715">std::<span class="me2">basic_ostream</span></span></a><span class="sy1">&lt;</span>CharT,Traits<span class="sy1">&gt;</span><span class="sy3">&amp;</span> ost,<br /></p>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">const</span> uniform_int_distribution<span class="sy3">&amp;</span> d <span class="br0">)</span><span class="sy4">;</span></div>
</td>
<td>(1)</td>
<td><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></td>
</tr>
<tr class="t-dcl t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> CharT, <span class="kw1">class</span> Traits <span class="sy1">&gt;</span><br /></span>
<p><span class="kw1">friend</span> <a href="cpp-io-basic_istream.html"><span class="kw1713">std::<span class="me2">basic_istream</span></span></a><span class="sy1">&lt;</span>CharT,Traits<span class="sy1">&gt;</span><span class="sy3">&amp;</span><br />
&nbsp; &nbsp; operator<span class="sy1">&gt;&gt;</span><span class="br0">(</span> <a href="cpp-io-basic_istream.html"><span class="kw1713">std::<span class="me2">basic_istream</span></span></a><span class="sy1">&lt;</span>CharT,Traits<span class="sy1">&gt;</span><span class="sy3">&amp;</span> ist,<br /></p>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uniform_int_distribution<span class="sy3">&amp;</span> d <span class="br0">)</span><span class="sy4">;</span></div>
</td>
<td>(2)</td>
<td><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#22312;&#20266;&#38543;&#26426;&#25968;&#20998;&#24067; <code>d</code> &#19978;&#36827;&#34892;&#27969;&#36755;&#20837;&#19982;&#36755;&#20986;&#12290;</p>
<div class="t-li1"><span class="t-li">1)</span> &#23558;&#20998;&#24067;&#21442;&#25968;&#21644;&#20869;&#37096;&#29366;&#24577;&#20316;&#20026;&#25991;&#26412;&#34920;&#31034;&#20889;&#20837; <code>ost</code> &#12290;&#19981;&#26356;&#25913; <code>ost</code> &#30340;&#26684;&#24335;&#21270;&#26631;&#24535;&#21644;&#22635;&#20805;&#23383;&#31526;&#12290;</div>
<div class="t-li1"><span class="t-li">2)</span> &#20197;&#35835;&#21462;&#33258; <code>ist</code> &#30340;&#25968;&#25454;&#24674;&#22797;&#20998;&#24067;&#21442;&#25968;&#21644;&#20869;&#37096;&#29366;&#24577;&#12290;&#19981;&#26356;&#25913; <code>ist</code> &#30340;&#26684;&#24335;&#21270;&#26631;&#24535;&#12290;&#25968;&#25454;&#24517;&#39035;&#29992;&#25317;&#26377;&#30456;&#21516;&#26412;&#22320;&#29615;&#22659;&#12289; <code>CharT</code> &#21644; <code>Traits</code> &#27169;&#26495;&#24418;&#21442;&#30340;&#27969;&#20889;&#20837;&#65292;&#21542;&#21017;&#34892;&#20026;&#26410;&#23450;&#20041;&#12290;&#33509;&#36935;&#21040;&#22351;&#36755;&#20837;&#65292;&#21017;&#35843;&#29992; <span class="t-c"><span class="mw-geshi cpp source-cpp">ist.<span class="me1">setstate</span><span class="br0">(</span>std<span class="sy4">::</span><span class="me2">ios</span><span class="sy4">::</span><span class="me2">failbit</span><span class="br0">)</span></span></span> &#65292;&#23427;&#21487;&#33021;&#25243;&#20986; <span class="t-lc"><a href="cpp-io-ios_base-failure.html">std::ios_base::failure</a></span> &#12290;&#35813;&#24773;&#20917;&#19979;&#19981;&#26356;&#25913; <code>d</code> &#12290;</div>
<p>&#36825;&#20123;&#20989;&#25968;&#27169;&#26495;&#23545;&#36890;&#24120;<a href="cpp-language-unqualified_lookup.html">&#26080;&#38480;&#23450;</a>&#25110;<a href="cpp-language-qualified_lookup.html">&#26377;&#38480;&#23450;&#26597;&#25214;</a>&#19981;&#21487;&#35265;&#65292;&#32780;&#21482;&#33021;&#22312; <code>std::uniform_int_distribution&lt;ResultType&gt;</code> &#20026;&#21442;&#25968;&#30340;&#20851;&#32852;&#31867;&#26102;&#30001;<a href="cpp-language-adl.html">&#23454;&#21442;&#20381;&#36182;&#26597;&#25214;</a>&#25214;&#21040;&#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>ost</td>
<td>-</td>
<td>&#25554;&#20837;&#25968;&#25454;&#21040;&#30340;&#36755;&#20986;&#27969;</td>
</tr>
<tr class="t-par">
<td>ist</td>
<td>-</td>
<td>&#25552;&#21462;&#25968;&#25454;&#26469;&#28304;&#30340;&#36755;&#20837;&#27969;</td>
</tr>
<tr class="t-par">
<td>d</td>
<td>-</td>
<td>&#20266;&#38543;&#26426;&#25968;&#20998;&#24067;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E8.BF.94.E5.9B.9E.E5.80.BC">&#36820;&#22238;&#20540;</span></h3>
<div class="t-li1"><span class="t-li">1)</span> <code>ost</code></div>
<div class="t-li1"><span class="t-li">2)</span> <code>ist</code></div>
<h3><span class="mw-headline" id=".E5.BC.82.E5.B8.B8">&#24322;&#24120;</span></h3>
<div class="t-li1"><span class="t-li">1)</span> &#21487;&#33021;&#25243;&#20986;&#23454;&#29616;&#23450;&#20041;&#30340;&#24322;&#24120;&#12290;</div>
<div class="t-li1"><span class="t-li">2)</span> &#36755;&#20837;&#38169;&#35823;&#26102;&#21487;&#33021;&#25243;&#20986; <span class="t-lc"><a href="cpp-io-ios_base-failure.html">std::ios_base::failure</a></span> &#12290;</div>
<h3><span class="mw-headline" id=".E7.BC.BA.E9.99.B7.E6.8A.A5.E5.91.8A">&#32570;&#38519;&#25253;&#21578;</span></h3>
<p>&#19979;&#21015;&#26356;&#25913;&#34892;&#20026;&#30340;&#32570;&#38519;&#25253;&#21578;&#36861;&#28335;&#22320;&#24212;&#29992;&#20110;&#20197;&#21069;&#20986;&#29256;&#30340; C++ &#26631;&#20934;&#12290;</p>
<table class="dsctable" style="font-size:0.8em">
<tr>
<th>DR</th>
<th>&#24212;&#29992;&#20110;</th>
<th>&#20986;&#29256;&#26102;&#30340;&#34892;&#20026;</th>
<th>&#27491;&#30830;&#34892;&#20026;</th>
</tr>
<tr>
<td><a rel="nofollow" class="external text" href="https://cplusplus.github.io/LWG/issue3519">LWG 3519</a></td>
<td>C++11</td>
<td>&#25554;&#20837;&#19982;&#25552;&#21462;&#36816;&#31639;&#31526;&#30340;&#24418;&#24335;&#26410;&#25351;&#23450;</td>
<td>&#25351;&#23450;&#20026;&#38544;&#34255;&#21451;&#20803;</td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>