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

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

?? stl_introduction.html

?? 指導程序員合理、高效的進行標準模板庫編程。
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Zafir Anjum">
   <TITLE>MFC Programmer's SourceBook : STL Programmer's Guide</TITLE>
    <META name="description" 
     content="A freely available implementation 
     of the C++ Standard Template Library, including 
     hypertext documentation.">
	<META name="keywords" 
	content="generic programming, STL, standard template library">
</HEAD>

<SCRIPT LANGUAGE="JavaScript"><!--
var adcategory = "cpp";
// -->
</SCRIPT>
<body background="../../fancyhome/back.gif" bgcolor="#FFFFFF" >
<SCRIPT LANGUAGE="JavaScript"><!--
var nfrm = location.href.indexOf("_nfrm_");
var validframes = (top.frames.length > 0 && top.frames['ad'] && top.frames['logo'] );
var random = Math.random();

if( !validframes && nfrm == -1 )
{
	var dclkPage = "www.codeguru.com/";
	if( self.adcategory )
		dclkPage += adcategory;
	else
		dclkPage += "mfc";
	document.write('<nolayer><center>');
	document.write('<iframe src="http://ad.doubleclick.net/adi/' + dclkPage + ';ord='
	 + random + '" width=470 height=62 marginwidth=0 marginheight=0 hspace=0 vspace=0 '
	 + 'frameborder=0 scrolling=no bordercolor="#000000">');
	document.write('<a href="http://ad.doubleclick.net/jump/' + dclkPage + ';ord='
	 + random + '">');
	document.write('<img src="http://ad.doubleclick.net/ad/' + dclkPage + ';ord='
	 + random + '" height=60 width=468>' + '</a>');
	document.write('</iframe>');
	document.write('</center></nolayer>');
	document.write('<layer  src="http://ad.doubleclick.net/adl/' + dclkPage + 
	 ';ord=' + random + '"></layer>');
	document.write('<ilayer visibility=hide width=468 height=83></ilayer>');
}


//		top.location = "/show.cgi?" + adcategory + "=" + location.pathname;


// -->
</SCRIPT>
<noscript>
<p align="center">
<a href="http://ad.doubleclick.net/jump/www.codeguru.com/cpp;ord=NupaBNFCY34AAHa7US4">
<img src="http://ad.doubleclick.net/ad/www.codeguru.com/cpp;ord=NupaBNFCY34AAHa7US4"></a>
</p>
</noscript>







<CENTER><H1 ALIGN="CENTER">
Introduction to the Standard Template Library</H1>
</CENTER><P>
The Standard Template Library, or <I>STL</I>, is a C++ library of 
container classes, algorithms, and iterators; it provides many of the 
basic algorithms and data structures of computer science. The STL is a <I>generic</I>
 library, meaning that its components are heavily parameterized: almost 
every component in the STL is a template. You should make sure that you 
understand how templates work in C++ before you use the STL.</P>
<H2>
Containers and algorithms</H2>
<P>
Like many class libraries, the STL includes <I>container</I> classes: 
classes whose purpose is to contain other objects. The STL includes the 
classes <TT><A href="Vector.html">vector</A></TT>, <TT><A href="List.html" tppabs="http://www.sgi.com/Technology/STL/List.shtml">list</A></TT>, <TT><A href="Deque.html" tppabs="http://www.sgi.com/Technology/STL/Deque.shtml">deque</A></TT>, <TT><A href="set.html" tppabs="http://www.sgi.com/Technology/STL/set.shtml">set</A></TT>, <TT><A href="multiset.html" tppabs="http://www.sgi.com/Technology/STL/multiset.shtml">multiset</A></TT>, <TT><A href="Map.html" tppabs="http://www.sgi.com/Technology/STL/Map.shtml">map</A></TT>, <TT><A href="Multimap.html" tppabs="http://www.sgi.com/Technology/STL/Multimap.shtml">multimap</A></TT>, <TT><A href="hash_set.html" tppabs="http://www.sgi.com/Technology/STL/hash_set.shtml">hash_set</A></TT>, <TT><A href="hash_multiset.html" tppabs="http://www.sgi.com/Technology/STL/hash_multiset.shtml">hash_multiset</A></TT>, <TT><A href="hash_map.html" tppabs="http://www.sgi.com/Technology/STL/hash_map.shtml">hash_map</A></TT>, 
and <TT><A href="hash_multimap.html">hash_multimap</A></TT>. Each of these classes is a template, 
and can be instantiated to contain any type of object. You can, for 
example, use a <TT>vector&lt;int&gt;</TT> in much the same way as you 
would use an ordinary C array, except that <TT>vector</TT> eliminates 
the chore of managing dynamic memory allocation by hand.</P>
<PRE>
      vector&lt;int&gt; v(3);            // Declare a vector of 3 elements.
      v[0] = 7;
      v[1] = v[0] + 3;
      v[2] = v[0] + v[1];          // v[0] == 7, v[1] == 10, v[2] == 17  
</PRE>
<P>
The STL also includes a large collection of <I>algorithms</I> that 
manipulate the data stored in containers. You can reverse the order of 
elements in a <TT>vector</TT>, for example, by using the <TT><A href="reverse.html">reverse</A></TT>
 algorithm. </P>
<PRE>
      reverse(v.begin(), v.end()); // v[0] == 17, v[1] == 10, v[2] == 7
</PRE>
<P>
There are two important points to notice about this call to <TT>reverse</TT>. 
First, it is a global function, not a member function. Second, it takes 
two arguments rather than one: it operates on a <I>range</I> of 
elements, rather than on a container. In this particular case the range 
happens to be the entire container <TT>v.</TT></P>
<P>
The reason for both of these facts is the same: <TT>reverse</TT>, like 
other STL algorithms, is decoupled from the STL container classes. This 
means that <TT>reverse</TT> can be used not only to reverse elements in 
vectors, but also to reverse elements in lists, and even elements in C 
arrays. The following program is also valid.</P>
<PRE>
      double A[6] = { 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 };
      reverse(A, A + 6);
      for (int i = 0; i &lt; 6; ++i)
        cout &lt;&lt; &quot;A[&quot; &lt;&lt; i &lt;&lt; &quot;] = &quot; &lt;&lt; A[i];
</PRE>
<P>
This example uses a <I>range</I>, just like the example of reversing a <TT>vector</TT>: 
the first argument to reverse is a pointer to the beginning of the 
range, and the second argument points one element past the end of the 
range. This range is denoted <TT>[A, A + 6)</TT>; the asymmetrical 
notation is a reminder that the two endpoints are different, that the 
first is the beginning of the range and the second is <I>one past</I>
 the end of the range. </P>
<H2>
Iterators</H2>
<P>
In the example of reversing a C array, the arguments to <TT>reverse</TT>
 are clearly of type <TT>double*</TT>. What are the arguments to 
reverse if you are reversing a <TT>vector</TT>, though, or a <TT>list</TT>? 
That is, what exactly does <TT>reverse</TT> declare its arguments to 
be, and what exactly do <TT>v.begin()</TT> and <TT>v.end()</TT> return? </P>
<P>
The answer is that the arguments to <TT>reverse</TT> are <I>iterators</I>, 
which are a generalization of pointers. Pointers themselves are 
iterators, which is why it is possible to reverse the elements of a C 
array. Similarly, <TT>vector</TT> declares the nested types <TT>iterator</TT>
 and <TT>const_iterator</TT>. In the example above, the type returned 
by <TT>v.begin()</TT> and <TT>v.end()</TT> is <TT>vector&lt;int&gt;::iterator</TT>. 
There are also some iterators, such as <TT><A href="istream_iterator.html">istream_iterator</A></TT>
and <TT><A href="ostream_iterator.html">ostream_iterator</A></TT>, that aren't associated with 
containers at all. </P>
<P>
Iterators are the mechanism that makes it possible to decouple 
algorithms from containers: algorithms are templates, and are 
parameterized by the type of iterator, so they are not restricted to a 
single type of container. Consider, for example, how to write an 
algorithm that performs linear search through a range. This is the 
STL's <TT><A href="find.html">find</A></TT> algorithm. </P>
<PRE>
      template &lt;class InputIterator, class T&gt;
      InputIterator find(InputIterator first, InputIterator last, const T&amp; value) {
          while (first != last &amp;&amp; *first != value) ++first;
          return first;
      }
</PRE>
<P>
<TT>Find</TT> takes three arguments: two iterators that define a range, 
and a value to search for in that range. It examines each iterator in 
the range <TT>[first, last)</TT>, proceeding from the beginning 
to the end, and stops either when it finds an iterator that points to <TT>value</TT>
 or when it reaches the end of the range. </P>
<P>
<TT>First</TT> and <TT>last</TT> are declared to be of type <TT>InputIterator</TT>, 
and <TT>InputIterator</TT> is a template parameter. That is, there 
isn't actually any type called <TT>InputIterator</TT>: when you call <TT>find</TT>, 
the compiler substitutes the actual type of the arguments for the 
formal type parameters <TT>InputIterator</TT> and <TT>T</TT>. If 
the first two arguments to <TT>find</TT> are of type <TT>int*</TT> and 
the third is of type <TT>int</TT>, then it is as if you had called the 
following function.</P>
<PRE>
      int* find(int* first, int* last, const int&amp; value) {
          while (first != last &amp;&amp; *first != value) ++first;
          return first;
      }
</PRE>
<H2>
Concepts and Modeling</H2>
<P>
One very important question to ask about any template function, not 
just about STL algorithms, is what the set of types is that may 
correctly be substituted for the formal template parameters. Clearly, 
for example, <TT>int*</TT> or <TT>double*</TT> may be substituted for <TT>find</TT>'s 
formal template parameter <TT>InputIterator</TT>. Equally clearly, <TT>int</TT>
 or <TT>double</TT> may not: <TT>find</TT> uses the expression <TT>*first</TT>, 
and the dereference operator makes no sense for an object of type <TT>int</TT>
 or of type <TT>double</TT>. The basic answer, then, is that <TT>find</TT>
 implicitly defines a set of requirements on types, and that it may be 
instantiated with any type that satisfies those requirements. Whatever 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费电影在线| 中文字幕免费不卡在线| 91免费在线视频观看| 福利一区二区在线| 麻豆国产欧美日韩综合精品二区 | 国产乱子轮精品视频| 日本aⅴ精品一区二区三区| 亚洲成人动漫精品| 日日噜噜夜夜狠狠视频欧美人| 亚洲午夜在线视频| 日韩va亚洲va欧美va久久| 日韩电影一区二区三区四区| 美女在线观看视频一区二区| 极品销魂美女一区二区三区| 国产成人a级片| 色婷婷一区二区| 欧美丰满少妇xxxxx高潮对白| 日韩欧美国产一二三区| 久久精品一二三| 亚洲美女屁股眼交| 三级精品在线观看| 国产精品影视在线观看| 94-欧美-setu| 欧美一级电影网站| 中文在线免费一区三区高中清不卡| 亚洲免费伊人电影| 婷婷丁香激情综合| 国产在线视频一区二区三区| 97精品超碰一区二区三区| 欧美日韩亚洲国产综合| xnxx国产精品| 亚洲一区中文在线| 国产麻豆精品一区二区| av一本久道久久综合久久鬼色| 欧美日韩精品系列| 国产欧美日产一区| 视频在线在亚洲| 丁香啪啪综合成人亚洲小说 | 欧洲精品在线观看| 久久亚洲精品小早川怜子| 亚洲丝袜制服诱惑| 精品在线播放免费| 欧美手机在线视频| 国产精品嫩草影院com| 肉色丝袜一区二区| 成人黄色777网| 2017欧美狠狠色| 亚洲成人三级小说| 99精品黄色片免费大全| 欧美电影精品一区二区| 亚洲一区二区综合| 粉嫩av一区二区三区在线播放| 欧美一区二区三区啪啪| 夜夜爽夜夜爽精品视频| 成人免费毛片app| 久久网站最新地址| 日韩av不卡一区二区| 色呦呦一区二区三区| 国产视频一区二区在线观看| 美女视频黄 久久| 欧美日韩高清一区二区不卡| 亚洲免费观看在线观看| 成人黄色电影在线 | 欧美性xxxxx极品少妇| 欧美国产成人在线| 国产成人欧美日韩在线电影| 精品国产一区二区三区不卡| 天天操天天色综合| 欧美亚男人的天堂| 亚洲一二三四区| 欧美午夜精品一区二区蜜桃| 成人免费在线视频| 成人av高清在线| 国产精品久久99| 91免费在线看| 亚洲一二三专区| 欧美高清www午色夜在线视频| 亚洲国产视频a| 欧美人狂配大交3d怪物一区| 丝袜国产日韩另类美女| 91精品国产欧美一区二区| 免费欧美日韩国产三级电影| 91精品国产aⅴ一区二区| 蜜臀久久久99精品久久久久久| 日韩美一区二区三区| 久久福利资源站| 国产三级欧美三级日产三级99| 国产宾馆实践打屁股91| 国产精品久久久久久亚洲毛片| 色综合久久88色综合天天6| 一区二区三区美女视频| 欧美一区二区三区小说| 黄色精品一二区| 国产精品成人免费在线| 在线免费视频一区二区| 丝袜诱惑制服诱惑色一区在线观看 | 捆绑调教美女网站视频一区| 久久久国产精品不卡| 成人爱爱电影网址| 亚洲成人资源网| 久久久天堂av| 色老头久久综合| 麻豆久久久久久| 国产精品视频免费看| 欧美午夜精品久久久久久超碰 | 亚洲福利视频一区| 日韩一区二区三区免费看 | 大白屁股一区二区视频| 一区二区高清在线| 日韩一级高清毛片| 波多野结衣亚洲一区| 视频精品一区二区| 久久精品视频一区| 欧洲精品一区二区| 国产一区二区女| 亚洲h精品动漫在线观看| 国产无遮挡一区二区三区毛片日本| 91麻豆国产自产在线观看| 蜜臀久久99精品久久久久久9| 亚洲丝袜制服诱惑| 欧美精品一区二区三区在线播放| 色综合色综合色综合色综合色综合 | 极品美女销魂一区二区三区| **性色生活片久久毛片| 日韩精品在线网站| 色婷婷久久一区二区三区麻豆| 国产精品一区久久久久| 亚洲一区二区三区视频在线 | 亚洲电影一区二区| 久久精品日韩一区二区三区| 欧美精品在线观看一区二区| 不卡的电视剧免费网站有什么| 另类综合日韩欧美亚洲| 一卡二卡欧美日韩| 欧美国产精品中文字幕| 欧美精品一区二区三区很污很色的| 欧美在线观看一二区| 成人av小说网| 成人一区二区在线观看| 国产美女在线观看一区| 蜜臀av性久久久久蜜臀av麻豆| 亚洲一区在线观看免费观看电影高清| 中文字幕免费不卡| 久久久不卡网国产精品二区| 欧美zozozo| 精品久久一区二区三区| 欧美变态tickling挠脚心| 日韩欧美另类在线| 欧美精品1区2区| 欧美美女一区二区三区| 精品视频在线免费| 欧美伊人久久久久久久久影院| 色一情一伦一子一伦一区| 99国产麻豆精品| 色综合久久99| 欧美日韩一区三区四区| 欧美日韩小视频| 欧美日本一区二区三区| 在线观看91av| 日韩一级完整毛片| 日韩美女一区二区三区| 亚洲精品在线免费观看视频| 久久女同性恋中文字幕| 久久久久久免费网| 中文字幕精品一区二区三区精品| 国产免费成人在线视频| 国产精品污污网站在线观看| 亚洲免费视频成人| 亚洲综合精品自拍| 日韩中文字幕1| 激情综合亚洲精品| 成人精品高清在线| 色婷婷久久久亚洲一区二区三区| 欧美欧美午夜aⅴ在线观看| 制服丝袜亚洲网站| 精品处破学生在线二十三| 欧美激情综合五月色丁香小说| 亚洲美女免费在线| 日本特黄久久久高潮| 国模一区二区三区白浆| av亚洲产国偷v产偷v自拍| 欧美三级日本三级少妇99| 欧美videossexotv100| 亚洲视频免费在线| 五月婷婷久久丁香| 国产精品综合在线视频| 91在线观看一区二区| 91精品国产欧美一区二区成人| 国产精品国产馆在线真实露脸| 亚瑟在线精品视频| 国产精品一区在线观看你懂的| 91欧美一区二区| 日韩精品影音先锋| 一区二区三区影院| 精品一区二区三区蜜桃| 91国偷自产一区二区三区成为亚洲经典 | 日韩写真欧美这视频| 国产精品国模大尺度视频| 日本不卡高清视频| 一本久久a久久免费精品不卡|