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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stl_introduction.html

?? VC書籍介紹C++的應(yīng)用的TheOODesignProcess.zip 電子書好用的
?? 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 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区在线观看| 91蝌蚪porny九色| 欧美日韩dvd在线观看| 亚洲欧美日韩在线不卡| 成人国产亚洲欧美成人综合网 | 日韩免费成人网| 日韩不卡一区二区三区| 欧美不卡视频一区| 国产一区二区在线观看视频| 精品国产91洋老外米糕| 高清不卡一二三区| 一区二区三区加勒比av| 欧美精品久久99| 国产一区二区精品在线观看| 中文在线一区二区| 日本精品裸体写真集在线观看| 一区二区三区在线观看视频| 欧美肥胖老妇做爰| 国产一区二区在线影院| 亚洲视频资源在线| 在线播放中文一区| 国产成人综合在线观看| 亚洲激情图片一区| 欧美成人精品福利| 94-欧美-setu| 老司机午夜精品99久久| 国产精品国产三级国产有无不卡| 欧美影院午夜播放| 国产原创一区二区三区| 亚洲蜜桃精久久久久久久| 91精品国产综合久久福利软件| 国产在线观看一区二区| 亚洲一区二区综合| 国产亚洲一本大道中文在线| 欧美中文字幕一区| 国产一级精品在线| 午夜精品福利一区二区三区蜜桃| 久久青草欧美一区二区三区| 欧美视频在线一区二区三区 | 国产激情91久久精品导航| 一区二区三区资源| 国产视频一区二区在线| 欧美精品国产精品| 色婷婷综合久久| 国产麻豆精品视频| 视频一区国产视频| 亚洲欧美日韩精品久久久久| 精品国产制服丝袜高跟| 欧美高清一级片在线| www.亚洲免费av| 国产在线日韩欧美| 日韩专区中文字幕一区二区| 最新国产の精品合集bt伙计| 久久亚洲精精品中文字幕早川悠里| 欧美专区日韩专区| 91在线视频观看| 高清免费成人av| 国产乱国产乱300精品| 婷婷久久综合九色国产成人| 伊人婷婷欧美激情| 国产精品色哟哟网站| 精品99一区二区| 欧美一区二区三区小说| 欧美色欧美亚洲另类二区| 99视频一区二区| 福利一区福利二区| 国产成人在线视频免费播放| 国产在线精品一区二区| 精油按摩中文字幕久久| 日韩二区在线观看| 日本一区中文字幕| 爽好久久久欧美精品| 日韩电影在线看| 免费久久精品视频| 看国产成人h片视频| 免费看欧美女人艹b| 久久精品国产亚洲5555| 久草在线在线精品观看| 免费视频最近日韩| 狠狠色丁香九九婷婷综合五月| 免费久久精品视频| 精品一区二区久久| 国产麻豆精品theporn| 国产99一区视频免费| 国产99精品国产| 成人h版在线观看| 91免费看`日韩一区二区| 色拍拍在线精品视频8848| 在线观看欧美日本| 欧美日韩精品免费观看视频| 91麻豆精品久久久久蜜臀| 91精品久久久久久久99蜜桃| 日韩欧美一级在线播放| 国产无一区二区| 中文字幕一区日韩精品欧美| 亚洲另类春色校园小说| 亚洲妇女屁股眼交7| 日韩成人一级大片| 国产精品一区久久久久| aaa亚洲精品| 欧美蜜桃一区二区三区| 欧美电视剧免费全集观看| 国产午夜亚洲精品理论片色戒| 国产精品久99| 午夜亚洲国产au精品一区二区| 日韩av电影免费观看高清完整版| 久久99国产精品尤物| 成人免费电影视频| 欧美午夜精品久久久| 亚洲精品一区二区三区香蕉| 国产精品久久久久天堂| 亚洲国产日产av| 国产一区二区按摩在线观看| 色综合天天综合网天天看片| 日韩欧美一区中文| 国产精品色在线观看| 丝袜脚交一区二区| 国产91对白在线观看九色| 欧美日韩一二三| 久久精品夜色噜噜亚洲a∨| 一区二区三区高清在线| 精品一区二区在线视频| 色综合久久88色综合天天免费| 欧美电影一区二区| 中文字幕av不卡| 蜜乳av一区二区三区| 99国产精品久| 久久女同精品一区二区| 亚洲一区二区偷拍精品| 国产福利91精品| 91丨九色porny丨蝌蚪| 日韩丝袜情趣美女图片| 亚洲人一二三区| 亚洲成在人线在线播放| 成人激情免费视频| 欧美一卡2卡三卡4卡5免费| 亚洲欧美日本在线| 久久精品国产网站| 4438成人网| 亚洲黄网站在线观看| 国产精品一区二区在线观看网站| 欧美精品久久久久久久多人混战 | 91香蕉视频黄| 精品成人一区二区| 午夜精品福利一区二区蜜股av| 国产一区二区三区四| 91精品国产综合久久婷婷香蕉| 亚洲色图制服诱惑 | 亚洲情趣在线观看| 国产·精品毛片| 久久久久国色av免费看影院| 日本aⅴ免费视频一区二区三区| 91浏览器在线视频| 亚洲国产精品二十页| 国产一区二区电影| 久久嫩草精品久久久精品| 精品一区二区三区不卡| 日韩三级在线观看| 日韩激情在线观看| 欧美日韩一级片网站| 亚洲国产日韩综合久久精品| 91色综合久久久久婷婷| 中文字幕亚洲在| 成人午夜伦理影院| 久久久久久亚洲综合影院红桃| 麻豆精品国产传媒mv男同| 日韩一区二区在线播放| 日韩av一区二区三区四区| 制服.丝袜.亚洲.中文.综合| 日韩电影在线一区| 欧美一级一级性生活免费录像| 日韩中文字幕区一区有砖一区| 欧美视频中文一区二区三区在线观看 | 国产剧情一区二区三区| 精品第一国产综合精品aⅴ| 琪琪一区二区三区| 精品精品国产高清一毛片一天堂| 久久爱www久久做| 久久亚洲综合av| 成人免费三级在线| 亚洲美女免费在线| 色偷偷久久人人79超碰人人澡| 亚洲精品成人在线| 精品视频色一区| 日韩**一区毛片| 久久亚区不卡日本| 成人av网站在线观看免费| 国产精品国产三级国产普通话三级| 99热精品国产| 亚洲一二三四在线观看| 欧美一区二区三区免费大片| 久久精品噜噜噜成人88aⅴ| 欧美激情在线观看视频免费| 色综合中文综合网| 韩国理伦片一区二区三区在线播放| xnxx国产精品| av色综合久久天堂av综合| 亚洲 欧美综合在线网络| 日韩一区二区在线观看视频播放| 黄色小说综合网站|