57 lines
3.4 KiB
HTML
57 lines
3.4 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::locale::id::id</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_locale_locale_id_id 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::locale::id::</span>id</h1>
|
|
<div id="bodyContent">
|
|
<div id="contentSub"><span class="subpages">< <a href="cpp.html">cpp</a>‎ | <a href="cpp-locale.html">locale</a>‎ | <a href="cpp-locale-locale.html">locale</a>‎ | <a href="cpp-locale-locale-id.html">id</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-dsc-header">
|
|
<td>
|
|
<div>定义于头文件 <code><a href="cpp-header-locale.html"><locale></a></code></div>
|
|
</td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr class="t-dcl">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp">id<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(1)</td>
|
|
<td class="t-dcl-nopad"></td>
|
|
</tr>
|
|
<tr class="t-dcl">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp">id<span class="br0">(</span><span class="kw4">const</span> id<span class="sy3">&</span><span class="br0">)</span> <span class="sy1">=</span> delete<span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(2)</td>
|
|
<td class="t-dcl-nopad"></td>
|
|
</tr>
|
|
<tr class="t-dcl-sep">
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>1) 默认构造函数:创建拥有实现指定内容的 <span class="t-lc"><a href="cpp-locale-locale-id.html">std::locale::id</a></span> 类型对象。</p>
|
|
<p>2) 复制构造函数被删除; <span class="t-lc"><a href="cpp-locale-locale-id.html">std::locale::id</a></span> 不可复制。</p>
|
|
<h3><span class="mw-headline" id=".E6.B3.A8.E6.84.8F">注意</span></h3>
|
|
<p>因为 locale 和 facet 必须对拥有静态存储期的 IO 流对象如 <span class="t-lc"><a href="cpp-io-cout.html">std::cout</a></span> 可用,典型的实现在静态初始化期间(在构造函数为静态对象运行之前),让隐式的默认构造函数零初始化 <span class="t-lc"><a href="cpp-locale-locale-id.html">std::locale::id</a></span> 的内容,而在首次添加 facet 到任何 locale 时, locale 完成 facet 的 <code>id</code> 的初始化。</p>
|
|
</div>
|
|
<div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|