⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vector.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<H3><CODE><A NAME="vector::assign">vector::assign</A></CODE></H3><PRE>template&lt;class InIt&gt;    void <B>assign</B>(InIt first, InIt last);void <B>assign</B>(size_type count, const Ty&amp; val);</PRE><P>If <CODE>InIt</CODE> is an integer type, the first memberfunction behaves the same as <CODE>assign((size_type)first, (Ty)last)</CODE>.Otherwise, thefirst member function replaces the sequencecontrolled by <CODE>*this</CODE> with the sequence<CODE>[first, last)</CODE>, which must <I>not</I> overlapthe initial controlled sequence.The second member function replaces the sequencecontrolled by <CODE>*this</CODE> with a repetition of <CODE>count</CODE>elements of value <CODE>val</CODE>.</P><H3><CODE><A NAME="vector::at">vector::at</A></CODE></H3><PRE>const_reference <B>at</B>(size_type off) const;reference <B>at</B>(size_type off);</PRE><P>The member function returns a reference to the element of thecontrolled sequence at position <CODE>off</CODE>. If that position isinvalid, the function throws an object of class<CODE>out_of_range</CODE>.</P><H3><CODE><A NAME="vector::back">vector::back</A></CODE></H3><PRE>reference <B>back</B>();const_reference <B>back</B>() const;</PRE><P>The member function returns a reference to the last element of thecontrolled sequence, which must be non-empty.</P><H3><CODE><A NAME="vector::begin">vector::begin</A></CODE></H3><PRE>const_iterator <B>begin</B>() const;iterator <B>begin</B>();</PRE><P>The member function returns a random-access iterator that points atthe first element of the sequence (or just beyond the end of an emptysequence).</P><H3><CODE><A NAME="vector::capacity">vector::capacity</A></CODE></H3><PRE>size_type <B>capacity</B>() const;</PRE><P>The member function returns the storage currently allocated to holdthe controlled sequence, a value at least as large as<CODE><A HREF="#vector::size">size</A>()</CODE>.</P><H3><CODE><A NAME="vector::clear">vector::clear</A></CODE></H3><PRE>void <B>clear</B>();</PRE><P>The member function calls<CODE><A HREF="#vector::erase">erase</A>(<A HREF="#vector::begin">begin</A>(),<A HREF="#vector::end">end</A>())</CODE>.</P><H3><CODE><A NAME="vector::const_iterator">vector::const_iterator</A></CODE></H3><PRE>typedef T1 <B>const_iterator</B>;</PRE><P>The type describes an object that can serve as a constantrandom-access iterator for the controlled sequence.It is described here as asynonym for the implementation-defined type <CODE>T1</CODE>.</P><H3><CODE><A NAME="vector::const_pointer">vector::const_pointer</A></CODE></H3><PRE>typedef typename Alloc::const_pointer    <B>const_pointer</B>;</PRE><P>The type describes an object that can serve as a constant pointerto an element of the controlled sequence.</P><H3><CODE><A NAME="vector::const_reference">vector::const_reference</A></CODE></H3><PRE>typedef typename Alloc::const_reference    <B>const_reference</B>;</PRE><P>The type describes an object that can serve as a constant referenceto an element of the controlled sequence.</P><H3><CODE><A NAME="vector::const_reverse_iterator">vector::const_reverse_iterator</A></CODE></H3><PRE>typedef reverse_iterator&lt;const_iterator&gt;    <B>const_reverse_iterator</B>;</PRE><P>The type describes an object that can serve as a constant reverseiterator for the controlled sequence.</P><H3><CODE><A NAME="vector::difference_type">vector::difference_type</A></CODE></H3><PRE>typedef T3 <B>difference_type</B>;</PRE><P>The signed integer type describes an object that can represent thedifference between the addresses of any two elements in the controlledsequence. It is described here as asynonym for the implementation-defined type <CODE>T3</CODE>.</P><H3><CODE><A NAME="vector::empty">vector::empty</A></CODE></H3><PRE>bool <B>empty</B>() const;</PRE><P>The member function returns true for an empty controlled sequence.</P><H3><CODE><A NAME="vector::end">vector::end</A></CODE></H3><PRE>const_iterator <B>end</B>() const;iterator <B>end</B>();</PRE><P>The member function returns a random-access iterator that pointsjust beyond the end of the sequence.</P><H3><CODE><A NAME="vector::erase">vector::erase</A></CODE></H3><PRE>iterator <B>erase</B>(iterator where);iterator <B>erase</B>(iterator first, iterator last);</PRE><P>The first member function removes the element of the controlledsequence pointed to by <CODE>where</CODE>. The second member functionremoves the elements of the controlled sequencein the range <CODE>[first, last)</CODE>.Both return an iterator that designates the first element remainingbeyond any elements removed, or<CODE><A HREF="#vector::end">end</A>()</CODE> if no such element exists.</P><P>Erasing <CODE>N</CODE> elements causes <CODE>N</CODE> destructor callsand an assignment for each of the elements between the insertionpoint and the end of the sequence. No<A HREF="#vector reallocation">reallocation</A> occurs,so iterators and references become<A HREF="#invalid vector iterators">invalid</A> only from the first elementerased through the end of the sequence.</P><P>The member functions throw an exception only if a copy operationthrows an exception.</P><H3><CODE><A NAME="vector::front">vector::front</A></CODE></H3><PRE>reference <B>front</B>();const_reference <B>front</B>() const;</PRE><P>The member function returns a reference to the first element of thecontrolled sequence, which must be non-empty.</P><H3><CODE><A NAME="vector::get_allocator">vector::get_allocator</A></CODE></H3><PRE>Alloc <B>get_allocator</B>() const;</PRE><P>The member function returns the stored<A HREF="memory.html#allocator object">allocator object</A>.</P><H3><CODE><A NAME="vector::insert">vector::insert</A></CODE></H3><PRE>iterator <B>insert</B>(iterator where, const Ty&amp; val);void <B>insert</B>(iterator where, size_type count, const Ty&amp; val);template&lt;class InIt&gt;    void <B>insert</B>(iterator where, InIt first, InIt last);</PRE><P>Each of the member functions inserts, before the element pointed toby <CODE>where</CODE> in the controlled sequence, a sequencespecified by the remaining operands. The first member function insertsa single element with value <CODE>val</CODE> and returns an iteratorthat designates the newly inserted element. The second member functioninserts a repetition of <CODE>count</CODE> elements of value <CODE>val</CODE>.<P>If <CODE>InIt</CODE> is an integer type, the last memberfunction behaves the same as <CODE>insert(where, (size_type)first, (Ty)last)</CODE>.Otherwise, thelast member function inserts the sequence<CODE>[first, last)</CODE>, which must <I>not</I> overlapthe initial controlled sequence.</P><P>When inserting a single element, the number ofelement copies is linear in the number of elements between the insertionpoint and the end of the sequence. When inserting a single elementat the end of the sequence, the amortized number of element copiesis constant. When inserting <CODE>N</CODE> elements,the number of element copiesis linear in <CODE>N</CODE> plus the number of elementsbetween the insertion point and the end of the sequence-- except when the template memberis specialized for <CODE>InIt</CODE> an input iterator, whichbehaves like <CODE>N</CODE> single insertions.</P><P>If<A HREF="#vector reallocation">reallocation</A> occurs, the capacityincreases by a fixed factor (at least),and all iterators and references become<A HREF="#invalid vector iterators">invalid</A>.If no reallocation occurs, iterators become invalidonly from the point of insertion through the end of the sequence.</P><P>If an exception is thrown during theinsertion of one or more elements, and the exception is not thrown whilecopying an element, the container is left unalteredand the exception is rethrown.</P><H3><CODE><A NAME="vector::iterator">vector::iterator</A></CODE></H3><PRE>typedef T0 <B>iterator</B>;</PRE><P>The type describes an object that can serve as a random-accessiterator for the controlled sequence.It is described here as asynonym for the implementation-defined type <CODE>T0</CODE>.</P><H3><CODE><A NAME="vector::max_size">vector::max_size</A></CODE></H3><PRE>size_type <B>max_size</B>() const;</PRE><P>The member function returns the length of the longest sequence thatthe object can control.</P><H3><CODE><A NAME="vector::operator[]">vector::operator[]</A></CODE></H3><PRE>const_reference <B>operator[]</B>(size_type off) const;reference <B>operator[]</B>(size_type off);</PRE><P>The member function returns a reference to the element of thecontrolled sequence at position <CODE>off</CODE>. If that position isinvalid, the behavior is undefined.</P><H3><CODE><A NAME="vector::pointer">vector::pointer</A></CODE></H3><PRE>typedef typename Alloc::pointer <B>pointer</B>;</PRE><P>The type describes an object that can serve as a pointer to anelement of the controlled sequence.</P><H3><CODE><A NAME="vector::pop_back">vector::pop_back</A></CODE></H3><PRE>void <B>pop_back</B>();</PRE><P>The member function removes the last element of thecontrolled sequence, which must be non-empty.</P><P>The member function never throws an exception.</P><H3><CODE><A NAME="vector::push_back">vector::push_back</A></CODE></H3><PRE>void <B>push_back</B>(const Ty&amp; val);</PRE><P>The member function inserts an element with value <CODE>val</CODE>at the end of the controlled sequence.</P><P>If an exception is thrown, the container is left unalteredand the exception is rethrown.</P><H3><CODE><A NAME="vector::rbegin">vector::rbegin</A></CODE></H3><PRE>const_reverse_iterator <B>rbegin</B>() const;reverse_iterator <B>rbegin</B>();</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -