亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tour-stdcxx.html

?? 一個比較通用的大數運算庫
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<html>
<head>
<title>
A Tour of NTL: Traditional and ISO Modes  </title>
</head>

<body bgcolor="#fff9e6">
<center>
<a href="tour-modules.html"><img src="arrow1.gif" alt="[Previous]" align=bottom></a>
 <a href="tour.html"><img src="arrow2.gif" alt="[Up]" align=bottom></a> 
<a href="tour-unix.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a>
</center>

<h1> 
<p align=center>
A Tour of NTL: Traditional and ISO Modes
</p>
</h1>

<p> <hr> <p>

<p>

As of version 4.1,
NTL can be compiled and used in one of two modes: Traditional or ISO.
<i>As of NTL version 5.4, ISO mode is the default.</i>

<p>
To revert to traditional mode, you can pass <tt>NTL_STD_CXX=off</tt>
as an argument to the configuration script
when <a href="tour-unix.html">installing NTL on a Unix or Unix-like system</a>,
which will unset the flag <tt>NTL_STD_CXX</tt> in the <tt>config.h</tt>
file.
Alternatively (and especially on non-Unix systems),
you can unset this flag  by hand by editing 
the the <tt>config.h</tt> file.
<p>



<p>
In Traditional mode, the NTL header files include the traditional
<tt>C++</tt> header files <tt>&lt;stdlib.h&gt;</tt>,
<tt>&lt;math.h&gt;</tt>, and <tt>&lt;iostream.h&gt;</tt>.
These files declare a number of names (functions, types, etc.)
in the <i>global namespace</i>.
Additionally, the NTL header files declare a number of names,
also in the global namespace.

<p>
In ISO mode, three things change:

<ol>
<li>
<b>NTL namespace:</b>
The NTL header files wrap all NTL names in a namespace, called <tt>NTL</tt>.

<p>
<li>
<b>New header files:</b>
The NTL header files include the new <tt>C++</tt> 
header files <tt>&lt;cstdlib&gt;</tt>,
<tt>&lt;cmath&gt;</tt>, and <tt>&lt;iostream&gt;</tt>.
These new header files are essentially the same as the traditional ones,
except that all the the names are declared in a namespace called 
<tt>std</tt>.

<p>
<li>
<b>Nothrow new:</b>
The NTL implementation files use the <tt>nothrow</tt> version of <tt>new</tt>.
</ol>



<p>
If your complier is not up to date, but you want some of the benefits
of Standard <tt>C++</tt>, you can set the <i>partial standard</i>
flags to get any subset of the above three changes:
<p>
<ol>
<li>
<tt>NTL_PSTD_NNS</tt>: NTL namespace
<li>
<tt>NTL_PSTD_NHF</tt>: New header files
<li>
<tt>NTL_PSTD_NTN</tt>: Nothrow new
</ol>

You can set these flags either by using the configuration script
(only on Unix-like systems), or by editing the <tt>config.h</tt> file.
For example, to just wrap NTL in a namepsace, just pass 
<tt>NTL_PSTD_NNS=on</tt>
as an argument to the configuration script
when installing NTL.
However, make sure you also turn off the <tt>NTL_STD_CXX</tt> flag;
otherwise, these have no effect.

<p>

Especially when combining NTL with other libraries, the
<tt>NTL_PSTD_NNS</tt> flag may be particularly useful
in avoiding name clashes, even if your compiler has just a
rudimentary implementation of namespaces.

<p>
NTL will remain usable in Traditional mode indefinitely,
assuming compilers maintain reasonable backward compatibilty with 
pre-standard <tt>C++</tt> conventions for header files;
however, if you want to <i>program for the future</i>, it is recommended
to use ISO mode.
The partial ISO modes are not highly recommended;
they are mainly intended as a stop-gap measure 
while we wait for decent standard-conforming <tt>C++</tt>
compilers to become available.


<p>
<h3>
A crash course on namespaces
</h3>

<p>
As already mentioned, the main difference between Traditional and ISO
mode is that in ISO mode, all names are wrapped in namespaces.
Namespaces are a feature that was introduced in the new <tt>C++</tt> standard.
One can declare names (functions, types, etc.) inside a namespace.
By default,
such names are not visible outside the namespace without explicit
qualification.

<p>
The main advantage of namespaces is that it solves the <i>namespace pollution
problem</i>:
if two libraries define the same name in two inconsistent ways,
it is very difficult, if not impossible,
to combine these two libraries in the same 
program.

<p>
The traditional way of avoiding such problems in languages like
<tt>C</tt> is for a library designer to attach a prefix specific
to that library to all names.
This works, but makes for ugly code.
The function overloading mechanism in <tt>C++</tt> eases the problem a bit,
but is still not a complete solution.

<p>

The new
namespace feature in <tt>C++</tt>
provides a reasonably complete and elegant solution to the namespace
pollution problem.
It is one of the nicest and most important recent additions to the <tt>C++</tt>
language.

<p>

Here is a simple example to illustrate namespaces.
<p>
<pre>

namespace N {
   void f(int);
   void g(int);
   int x;
}

int x;

void h()
{
   x = 1;    // the global x
   N::x = 0; // the x in namespace N
   N::f(0);  // the f in namespace N
   g(1);     // error -- g is not visible here
}

</pre>

<p>
All of this explicit qualification business
can be a bit tedious.
The easiest way to avoid this tedium is to use what is called
a <i>using directive</i>, which effectively makes
all names declared within a namespace visible in the
global scope.

Here is a variation on the previous example, with a using directive.

<p>
<pre>

namespace N {
   void f(int);
   void g(int);
   int x;
}

int x;

using namespace N;

void h()
{
   x = 1;    // error -- ambiguous: the global x or the x in namespace N?
   ::x = 1;  // the global x
   N::x = 0; // the x in namespace N
   N::f(0);  // the f in namespace N
   f(0);     // OK -- N::f(int) is visible here
   g(1);     // OK -- N::g(int) is visible here
}

</pre>

<p>
Here is another example.

<p>
<pre>

namespace N1 {
   int x;
   void f(int);
   void g(int);
}

namespace N2 {
   int x;
   int y;
   void f(double);
   void g(int);
}

using namespace N1;
using namespace N2;

void h()
{
   x = 1;     // error -- ambiguous: N1::x or N2::x?
   N1::x = 1; // OK
   N2::x = 1; // OK
   y = 1;     // OK  -- this is N2::y
   g(0);      // error -- ambiguous: N1::g(int) or N2::g(int)?
   f(0);      // OK -- N1::f(int), because it is the "best" match 
   f(0.0);    // OK  -- N2::f(double), because it is the "best" match
}

</pre>

<p>
This example illustrates the interaction between using declarations
and function overloading resolution.
If several overloaded versions of a function are visible,
it is not necessarily ambiguous: the usual overload resolution
procedure is applied, and if there is a unique "best" match,
then there is no ambiguity.

<p>

The examples presented here do not illustrate all of the
features and nuances of namespaces.
For this, you are referred to a <tt>C++</tt> book.

<p>
<h3>
Namespaces and NTL
</h3>

<p>
In ISO mode, the standard library is "wrapped" in namespace <tt>std</tt>,
and NTL is "wrapped" in namespace <tt>NTL</tt>.
Thus, the header file <tt>&lt;NTL/ZZ.h&gt;</tt> in ISO mode looks
something like this:
<pre>

namespace NTL {

   // ...

   class ZZ { /* ... */ };

   // ...

   ZZ operator+(const ZZ&amp; a, const ZZ&amp; b);
   ZZ operator*(const ZZ&amp; a, const ZZ&amp; b);

   std::istream&amp; operator>>(std::istream&amp; s, ZZ&amp; x);
   std::ostream&amp; operator<<(std::ostream&amp; s, const ZZ&amp; a);

   // ...

  
}

</pre>

Therefore, one must explicitly qualify all names, or use appropriate
using directives.
Here is how one could write the <a href="tour-ex1.html">first example</a> 
of the tour in
ISO mode.

<pre>

#include &lt;NTL/ZZ.h&gt;

int main()
{
   NTL::ZZ a, b, c; 

   std::cin &gt;&gt; a; 
   std::cin &gt;&gt; b; 
   c = (a+1)*(b+1);
   std::cout &lt;&lt; c &lt;&lt; "\n";
}

</pre>

<p>
Notice how everything is explicitly qualified.
Actually, the input/output operators <tt>&lt;&lt;</tt> and <tt>&gt;&gt;</tt>,
and the arithmetic operators <tt>+</tt> and <tt>*</tt> are not explicitly
qualified, but rather, the compiler finds them through a gimmick
called <i>Koenig Lookup</i>, which will look for functions (and operators)
declared in namespace <tt>NTL</tt>, because the type of the argument
(<tt>ZZ</tt>) is a class declared in that namespace.

<p>

Even with Koenig Lookup, explicit qualification can
be a bit tedious.
Here is the same example, this time with using directives.

<pre>

#include &lt;NTL/ZZ.h&gt;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区四区五区 | 国产精品免费久久久久| 欧美激情一区二区三区四区| 男女男精品网站| 99国产欧美久久久精品| 制服丝袜中文字幕一区| 国产精品久久久久一区| 蜜臀av亚洲一区中文字幕| www.久久精品| 久久久精品天堂| 日韩1区2区3区| 欧美三级电影在线看| 国产精品网站在线观看| 韩国v欧美v日本v亚洲v| 欧美一区二区三区视频| 亚洲观看高清完整版在线观看 | 日韩欧美123| 亚洲伦理在线精品| 东方aⅴ免费观看久久av| 日韩欧美中文字幕制服| 奇米777欧美一区二区| 欧美日韩成人高清| 亚洲午夜久久久久中文字幕久| 成人午夜伦理影院| 中文av一区特黄| 成人午夜视频网站| 国产精品久久久久久久久久久免费看 | 男男成人高潮片免费网站| 色噜噜狠狠成人网p站| 亚洲视频在线一区二区| 色综合久久88色综合天天免费| 国产亚洲一区二区三区在线观看| 蜜臀av性久久久久蜜臀aⅴ| 91精品在线免费| 蜜臀av在线播放一区二区三区| 日韩一区二区精品葵司在线| 日韩成人一级大片| 久久综合久久鬼色中文字| 国产精品自拍av| 中文字幕av一区二区三区| av动漫一区二区| 一区二区三区四区不卡视频| 在线观看日韩高清av| 五月婷婷激情综合| 欧美成人性福生活免费看| 国产成人综合自拍| 中文字幕综合网| 欧美日韩一本到| 另类人妖一区二区av| 国产亚洲综合在线| 91蜜桃在线免费视频| 亚洲成人久久影院| 精品噜噜噜噜久久久久久久久试看| 国产一区二区精品久久91| 欧美激情一区二区三区不卡| 欧美三级一区二区| 美美哒免费高清在线观看视频一区二区| 精品伦理精品一区| 91视频国产观看| 天天影视涩香欲综合网| 国产丝袜美腿一区二区三区| 日本久久精品电影| 久久精品国产精品亚洲精品 | 日韩欧美综合在线| 国产成人精品亚洲日本在线桃色| 亚洲欧美经典视频| 欧美电影免费提供在线观看| 97精品国产露脸对白| 日韩av电影免费观看高清完整版| 中文字幕的久久| 7777精品伊人久久久大香线蕉超级流畅| 伦理电影国产精品| 亚洲欧美另类图片小说| 久久综合久久鬼色中文字| 欧美无砖专区一中文字| 国产福利一区在线观看| 亚洲福中文字幕伊人影院| 国产欧美日韩另类视频免费观看| 欧美三级乱人伦电影| 国产成人在线视频网址| 天堂久久一区二区三区| 国产精品久久福利| www激情久久| 欧美日韩成人在线| av电影天堂一区二区在线| 国产综合久久久久久鬼色| 午夜精品福利一区二区蜜股av | 成人免费高清在线| 免费在线观看一区二区三区| 亚洲精品一二三| 国产亚洲欧美在线| 日韩精品中午字幕| 欧美精品在线观看播放| 在线看日韩精品电影| 成人avav影音| 国产精品77777竹菊影视小说| 日韩av一二三| 亚洲成人免费在线观看| 一区二区三区中文免费| 综合分类小说区另类春色亚洲小说欧美 | 乱一区二区av| 青青草国产精品亚洲专区无| 亚洲国产日韩一级| 亚洲国产中文字幕在线视频综合| 亚洲人成伊人成综合网小说| 国产精品天美传媒沈樵| 中文无字幕一区二区三区 | 91精品国产色综合久久| 欧美人牲a欧美精品| 欧美少妇一区二区| 欧美影院精品一区| 欧美视频完全免费看| 欧美蜜桃一区二区三区| 欧美亚洲另类激情小说| 欧美私模裸体表演在线观看| 色婷婷亚洲综合| 欧美日韩一区中文字幕| 欧美日韩国产bt| 91精品婷婷国产综合久久| 在线成人免费视频| 日韩三级在线观看| 久久久噜噜噜久噜久久综合| 亚洲精品自拍动漫在线| 亚洲免费在线播放| 亚洲一区二区三区小说| 五月综合激情网| 蜜桃久久久久久| 风间由美一区二区三区在线观看 | 一区二区三区 在线观看视频| 亚洲精品视频在线观看网站| 亚洲一二三四区| 蜜臀91精品一区二区三区| 国产美女视频一区| 99久久久精品| 欧美日韩中文精品| 日韩免费视频一区| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美日韩mp4| 337p粉嫩大胆噜噜噜噜噜91av | 成人av影视在线观看| 色女孩综合影院| 制服丝袜亚洲色图| 国产欧美精品区一区二区三区| 中文字幕不卡在线| 日韩av中文在线观看| 国产99精品视频| 欧美人妖巨大在线| 国产精品美女一区二区| 日本欧美韩国一区三区| 国产 欧美在线| 884aa四虎影成人精品一区| 久久精品欧美日韩精品| 亚洲v精品v日韩v欧美v专区| 国产精品91xxx| 欧美丰满一区二区免费视频| 久久久午夜精品理论片中文字幕| 亚洲欧美另类综合偷拍| 国产中文一区二区三区| 欧美日韩在线直播| 国产精品久久福利| 国产一区 二区 三区一级| 精品视频1区2区| 国产欧美综合色| 老司机一区二区| 欧美色综合天天久久综合精品| 国产农村妇女精品| 麻豆91精品视频| 欧美中文字幕一区| 欧美韩国一区二区| 久久丁香综合五月国产三级网站| 色系网站成人免费| 国产精品久久久久久久久久久免费看 | 不卡av电影在线播放| 91精品国产综合久久久蜜臀图片| 成人免费在线视频观看| 极品少妇xxxx精品少妇| 欧美巨大另类极品videosbest| 中文字幕视频一区| 国产成人精品在线看| 亚洲精品一区二区三区影院 | 午夜av电影一区| 色综合激情五月| 亚洲欧洲www| 国产·精品毛片| 久久免费视频一区| 激情成人综合网| 日韩精品专区在线影院重磅| 日韩成人av影视| 欧美一级艳片视频免费观看| 亚洲成人av一区| 欧美欧美午夜aⅴ在线观看| 一区二区三区久久久| 色综合天天综合| 亚洲三级在线播放| 91女人视频在线观看| 亚洲精品视频一区| 91日韩一区二区三区| 一区二区免费在线播放| 欧美中文字幕亚洲一区二区va在线 | 精品一区二区免费看|