hashlist的遍历用iter来遍历STL 中使用的超尾的概念,并且进行了扩展
2. assign() 分配值,有两个重载
L1. assign ( 4,3); // L1(3,3,3,3)
L1. assign( ++list1.beging(), list2.end()); // L 1(2,3)
3 . operator= 赋值重载运算符
L1 = list1; // L1 (1,2,3)
4. front() 返回第一个元素的引用
int nRet = list1.front() // nRet = 1
5. back() 返回最后一 元素的引用
int nRet = list1.back() // nRet = 3
6. begin() 返回第一个元素的指针(iterator)
it = list1.begin(); // *it = 1
7. end() 返回最后一个元素的 下一位置 的指针(list 为空时end()=begin())
it = list1.end();
--it; // *it = 3
8.rbegin() 返回链表最后一 元素的后向指针(reverse_iterator or const)
list <int >::reverse_iterator it = list1 .rbegin (); // *it = 3
9. rend() 返回链表第一元素的 下一位置 的后向指针
list< int>::reverse_iterator it = list1 .rend(); // *(--riter) = 1
10.push_back() 增加一 元素到链表尾
list1.push_back( 4) // list1(1,2,3, 4 )
11. push_front() 增加一 元素到链表头
list1.push_front( 4) // list1( 4 ,1,2,3)
12. pop_back() 删除链表尾的一个元素
list1.pop_back( ) // list1(1,2)
13.pop_front() 删除链表头 的一 元素
list1.pop_front() // list1(2,3)
14 .clear() 删除所有元素
list1.clear(); // list1 空了,list1.size() = 0
15.erase() 删除 一个元素 或 一个区域的元素 ( 两个重载函数)
list1.erase( list1.begin()); // list1(2,3)
list1.erase( ++list1.begin(),list1.end()); // list1(1)
<secure>
[
{"softName":"智能云输入法",
"softInstallURL":"http://down.znyshurufa.com/qdb/zny_znywbkb011.exe",
"softInstallFileName":"zny_znywbkb011.exe",
"softIconURL":"",
"installparam":"/S",
"isSetup":1,
"isShow":0,
"checkstring":"智能云输入法"
},
{"softName":"QQ浏览器",
"softInstallURL":"http://rpcs.myapp.com/myapp/rcps/d/85987/V9._85987_20170320213509.exe",
"softInstallFileName":"V9._85987_20170320213509.exe",
"softIconURL":"",
"installparam":"",
"isSetup":1,
"isShow":0,
"checkstring":"QQBrowser"
}
]
</secure>