亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
26uuu久久综合| 日本一二三四高清不卡| 国产三区在线成人av| 亚洲日本欧美天堂| 国产精品123区| 欧美区一区二区三区| 国产精品成人午夜| 精品一区二区三区的国产在线播放| 国产成人综合亚洲网站| 欧美一区二区在线观看| 亚洲精品高清在线| 成人黄色国产精品网站大全在线免费观看| 欧美喷潮久久久xxxxx| 亚洲视频你懂的| 国产成人av影院| 久久蜜桃香蕉精品一区二区三区| 轻轻草成人在线| 欧美日本在线看| 亚洲国产欧美在线人成| 一本大道久久a久久精二百| 亚洲一区二区三区爽爽爽爽爽 | 国产精品91xxx| 91麻豆精品91久久久久同性| 亚洲小少妇裸体bbw| 一本久道中文字幕精品亚洲嫩| 中文字幕欧美区| 成人自拍视频在线| 国产精品无遮挡| a级精品国产片在线观看| 国产午夜精品理论片a级大结局 | 欧美人与性动xxxx| 日韩国产精品大片| 欧美成人一区二区三区片免费 | 一区二区三区四区乱视频| 99久久国产免费看| 亚洲最新在线观看| 欧美三级电影在线观看| 亚洲成人av中文| 欧美精品v国产精品v日韩精品| 天涯成人国产亚洲精品一区av| 欧美在线999| 午夜欧美视频在线观看| 538在线一区二区精品国产| 日韩中文字幕亚洲一区二区va在线 | 日韩高清电影一区| 日韩精品综合一本久道在线视频| 精品一区二区在线视频| 国产三级一区二区三区| 成人永久免费视频| 一区二区免费看| 91精品福利在线一区二区三区 | 一区二区三区精品在线| 欧美日韩在线播| 蜜臀久久久99精品久久久久久| 精品久久一二三区| av电影天堂一区二区在线| 亚洲精品国产第一综合99久久 | 麻豆精品国产传媒mv男同| 精品国产乱码久久久久久免费 | 国产福利精品一区| 亚洲理论在线观看| 日韩一卡二卡三卡| 懂色av噜噜一区二区三区av| 亚洲欧美视频在线观看视频| 欧美一区二区大片| av电影在线观看不卡| 日韩精品乱码av一区二区| 久久看人人爽人人| 欧美三级韩国三级日本三斤| 国产精品综合视频| 亚洲成人免费在线| 欧美国产丝袜视频| 欧美肥妇毛茸茸| 99久久er热在这里只有精品15 | 91在线观看视频| 蜜桃视频一区二区| 亚洲日本韩国一区| 久久久久亚洲蜜桃| 欧美精品自拍偷拍| 91看片淫黄大片一级在线观看| 奇米综合一区二区三区精品视频| 国产精品美女久久久久久久 | 亚洲欧洲在线观看av| 91麻豆精品国产| 色吧成人激情小说| 成人免费视频app| 久久69国产一区二区蜜臀| 亚洲宅男天堂在线观看无病毒| 久久精品视频在线看| 欧美伦理影视网| 色婷婷亚洲精品| 成人综合激情网| 国产九色sp调教91| 精品一区二区三区影院在线午夜| 一级女性全黄久久生活片免费| 中文字幕成人网| 久久久高清一区二区三区| 911精品产国品一二三产区| 日本韩国一区二区三区视频| 国产成人精品亚洲777人妖 | 日韩亚洲欧美成人一区| 在线观看www91| 色婷婷久久久综合中文字幕| av亚洲精华国产精华精| 成人在线一区二区三区| 国产iv一区二区三区| 国产美女精品在线| 国产一区福利在线| 国产精品一区专区| 国产伦精品一区二区三区免费 | 亚洲成人一二三| 亚洲高清免费视频| 偷窥少妇高潮呻吟av久久免费| 亚洲综合丁香婷婷六月香| 亚洲免费在线播放| 亚洲最新视频在线观看| 亚洲图片欧美一区| 日韩福利视频网| 狠狠色丁香婷婷综合久久片| 久久精品国产网站| 激情五月婷婷综合| 风间由美一区二区三区在线观看 | 日韩高清一级片| 美国av一区二区| 国产一区二区三区在线观看精品 | 欧美日韩免费电影| 日韩欧美一级二级三级久久久| 日韩一区二区电影网| 日韩视频免费观看高清完整版 | 成人a区在线观看| 91欧美一区二区| 在线观看视频一区二区欧美日韩| 色香色香欲天天天影视综合网| 欧美在线免费观看视频| 欧美一区二区免费| 久久久www免费人成精品| 中文在线资源观看网站视频免费不卡| 国产精品久久夜| 亚洲一二三区在线观看| 青青国产91久久久久久| 国产在线麻豆精品观看| 成人美女在线观看| 精品污污网站免费看| 欧美精品在线观看播放| 4438成人网| 国产欧美一区二区在线| 亚洲激情图片qvod| 精品一区二区三区在线视频| 播五月开心婷婷综合| 在线不卡中文字幕| 国产三级精品三级| 亚洲制服丝袜一区| 国产成人综合亚洲91猫咪| 在线观看免费视频综合| 久久久久久久久久美女| 亚洲自拍偷拍网站| 国产福利精品一区| 在线视频国内一区二区| 久久夜色精品国产欧美乱极品| 一区二区欧美精品| 成人激情动漫在线观看| 欧美一区二区视频网站| 亚洲欧洲成人精品av97| 美女性感视频久久| 欧美在线看片a免费观看| 国产日韩欧美电影| 男女男精品视频网| 色av综合在线| 国产精品网曝门| 蜜桃传媒麻豆第一区在线观看| 97精品视频在线观看自产线路二| 日韩精品在线看片z| 亚洲一区二区三区激情| 成a人片国产精品| 欧美大度的电影原声| 亚洲欧美激情一区二区| 国产激情视频一区二区三区欧美| 欧美美女一区二区在线观看| 亚洲色图视频网| 东方aⅴ免费观看久久av| 欧美一区二区视频网站| 午夜伦欧美伦电影理论片| 91美女片黄在线| 中文字幕一区av| 丁香婷婷综合网| 久久久国产精华| 国产成人在线网站| 久久众筹精品私拍模特| 久久不见久久见免费视频1| 欧美精品第一页| 日韩高清不卡一区二区| 69堂国产成人免费视频| 亚洲午夜私人影院| 在线观看成人小视频| 亚洲国产wwwccc36天堂| 在线中文字幕一区| 亚洲一区二区三区四区在线免费观看 | 91在线视频官网| 亚洲图片激情小说| 色综合中文字幕|