47 lines
3.6 KiB
HTML
47 lines
3.6 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>标准库头文件 <ciso646></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_header_ciso646 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%">标准库头文件</span> <ciso646></h1>
|
|
<div id="bodyContent">
|
|
<div id="contentSub"><span class="subpages">< <a href="cpp.html">cpp</a>‎ | <a href="cpp-header.html">header</a></span></div>
|
|
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
|
|
<p>此头文件原作为 <code><b><iso646.h></b></code> 存在于 C 标准库。</p>
|
|
<p>兼容性头文件,在 C 中定义<a href="cpp-language-operator_alternative.html">代用运算符表示</a>,而它们在 C++ 中是关键词。</p>
|
|
<p>这表明在服从标准的实现中,包含此头文件无效果。</p>
|
|
<h3><span class="mw-headline" id=".E6.B3.A8.E8.A7.A3">注解</span></h3>
|
|
<p>在旧的或非标准编译器中,使用<a href="cpp-language-operator_alternative.html">代用运算符表示</a>可能仍需要包含此头文件。</p>
|
|
<p>C++20 前,包含 <code><ciso646></code> 有时作为一种技巧,用于获得实现特定的库版本宏而不导致其他效果。</p>
|
|
<p>C++20 开始,为此目的添加了头文件 <a href="cpp-header-version.html"><tt><version></tt></a>。</p>
|
|
<p>此头文件于 C++20 中移除。对应的 <code><iso646.h></code> 在 C++20 中仍可用。</p>
|
|
<div class="t-example">
|
|
<div class="t-example-live-link"></div>
|
|
<div dir="ltr" class="mw-geshi" style="text-align: left;">
|
|
<div class="cpp source-cpp">
|
|
<pre class="de1"><span class="co2">#include <ciso646></span>
|
|
<span class="co2">#ifdef _LIBCPP_VERSION</span>
|
|
<span class="co2">#error Using LLVM libc++</span>
|
|
<span class="co2">#elif __GLIBCXX__ // 注意:仅 6.1 或更新的版本在 ciso646 中定义它</span>
|
|
<span class="co2">#error Using GNU libstdc++</span>
|
|
<span class="co2">#elif _CPPLIB_VER // 注意:为 Visual Studio 所用</span>
|
|
<span class="co2">#error Using Dinkumware STL</span>
|
|
<span class="co2">#else</span>
|
|
<span class="co2">#error Using an unknown standard library</span>
|
|
<span class="co2">#endif</span></pre></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|