一、顺序容器的相关操作:
示例:
1 #include2 #include 3 #include 4 #include
5 6 using namespace std; 7 int main() 8 { 9 vector a;10 list b;11 deque c;12 13 vector ::size_type a1;14 vector ::iterator a2;15 vector ::const_iterator a3;16 vector ::reverse_iterator a4;17 vector ::const_reverse_iterator a5;18 vector ::difference_type a6;19 vector ::value_type a7;20 vector ::reference a8;21 vector ::const_reference a9;22 23 list ::size_type b1;24 list ::iterator b2;25 list ::const_iterator b3;26 list ::reverse_iterator b4;27 list ::reverse_iterator b4;28 list ::const_reverse_iterator b5;29 list ::difference_type b6;30 list ::value_type b7;31 list ::reference b8;32 list ::const_reference b9;33 34 deque ::size_type c1;35 deque ::iterator c2;36 deque ::const_iterator c3;37 deque ::reverse_iterator c4;38 deque ::const_reverse_iterator c5;39 deque ::difference_type c6;40 deque ::value_type c7;41 deque ::reference c8;42 deque ::const_reference c9;43 44 a.push_back(10);45 a.push_back(20);46 a.push_back(30);47 a.push_back(40);48 for(vector ::size_type i=0; i