Changes between Version 3 and Version 4 of code/howto/STL
- Timestamp:
- Oct 9, 2008, 1:06:20 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/howto/STL
v3 v4 3 3 4 4 == Overview == 5 STL stands for Standard Template Library. The STL implements several useful containers. This site provides a short overview of the most important containers. 6 5 7 || '''vector''' || Like an array, every element has an index || Fast to access elements by position || 6 8 || '''list''' || Elements are connected in a list, strictly ordered || Fast if you just want to store elements || … … 9 11 10 12 == Reference == 11 For more information have a look at the [http://www.cplusplus.com/reference/stl/ reference]. 13 For more information have a look at the [http://www.cplusplus.com/reference/stl/ reference]. Strongly recommended. 12 14 13 15 == Usage == 14 16 === vector === 15 17 {{{ 18 #include <vector> 19 16 20 std::vector<type> myVector; 17 21 … … 29 33 == list == 30 34 {{{ 35 #include <list> 36 31 37 std::list<type> myList; 32 38 … … 56 62 == set == 57 63 {{{ 64 #include <set> 65 58 66 std::set<type> mySet; 59 67 … … 85 93 === map === 86 94 {{{ 95 #include <map> 96 87 97 std::map<std::string, type> myMap; // Note: map has two template arguments, key and type 88 98