Tag: stl

563 push_back vs emplace_back 2010-11-29T12:04:09.360

532 Appending a vector to a vector 2010-03-31T09:33:02.303

517 Concatenating two std::vectors 2008-10-14T15:46:01.893

407 Iteration over std::vector: unsigned vs signed index variable 2009-01-03T16:52:24.593

393 How do I erase an element from std::vector<> by index? 2009-05-17T17:59:36.290

385 What's the difference between "STL" and "C++ Standard Library"? 2011-03-05T17:32:14.067

346 std::string formatting like sprintf 2010-02-26T14:15:54.290

343 How to find if a given key exists in a C++ std::map 2009-12-21T12:55:03.050

331 Why does the C++ STL not provide any "tree" containers? 2008-10-15T18:52:42.110

280 Why can't I make a vector of references? 2009-05-28T18:04:09.757

260 Sorting a vector in descending order 2012-01-26T20:47:02.990

251 How to check that an element is in a std::set? 2009-11-09T13:46:08.603

223 What's the most efficient way to erase duplicates and sort a vector? 2009-06-25T00:28:42.517

212 Best way to extract a subvector from a vector? 2009-01-07T18:56:28.663

210 Is std::unique_ptr<T> required to know the full definition of T? 2011-05-16T00:11:51.680

206 Why use iterators instead of array indices? 2008-09-25T02:58:08.823

206 C++ Erase vector element by value rather than by position? 2010-08-02T05:27:36.410

203 Why is the C++ STL is so heavily based on templates? (and not on *interfaces*) 2009-06-24T17:43:24.947

202 std::string length() and size() member functions 2009-05-25T05:49:55.543

200 Sorting a vector of custom objects 2009-09-04T17:05:37.303

199 Why is it wrong to use std::auto_ptr<> with standard containers? 2008-09-21T17:27:28.360

193 How do I print the elements of a C++ vector in GDB? 2008-10-31T10:33:14.180

193 Throwing the fattest people off of an overloaded airplane. 2011-10-12T21:11:54.397

192 Determine if map contains a value for a key? 2010-06-28T22:10:16.143

192 Is std::vector so much slower than plain arrays? 2010-09-08T02:38:41.903

189 In STL maps, is it better to use map::insert than []? 2008-11-28T15:42:52.337

187 vector vs. list in STL 2010-02-05T17:54:54.230

187 Why are Standard iterator ranges [begin, end) instead of [begin, end]? 2012-04-01T09:40:24.887

184 How to sum up elements of a C++ vector? 2010-07-11T03:59:34.200

183 How to retrieve all keys (or values) from a std::map and put them into a vector? 2008-09-21T03:23:58.233

183 Why does std::list::reverse have O(n) complexity? 2016-02-24T20:18:00.280

182 Remove spaces from std::string in C++ 2008-09-17T13:51:34.680

175 C++ STL Vectors: Get iterator from index? 2009-03-22T18:41:33.697

174 Why use non-member begin and end functions in C++11? 2011-09-29T06:00:08.763

173 C++ sorting and keeping track of indexes 2009-10-16T11:18:24.393

170 STL or Qt containers? 2009-11-03T16:00:37.317

169 How to convert wstring into string? 2011-01-26T11:58:01.500

166 Why can I not push_back a unique_ptr into a vector? 2010-07-19T18:13:18.373

165 In which scenario do I use a particular STL container? 2009-01-23T00:31:33.577

163 Thou shalt not inherit from std::vector 2010-12-04T11:05:46.497

158 Should I store entire objects, or pointers to objects in containers? 2008-09-26T19:10:38.280

156 Why is std::map implemented as a red-black tree? 2011-03-13T08:33:58.577

143 maximum value of int 2009-12-06T13:59:15.347

143 Advantages of std::for_each over for loop 2010-01-12T07:37:04.880

141 C++ valarray vs. vector 2009-10-21T17:53:31.017

141 What really is a deque in STL? 2011-06-09T11:52:47.903

139 What are the complexity guarantees of the standard containers? 2008-10-08T07:35:11.323

138 How do I clear the std::queue efficiently? 2009-04-02T10:16:13.073

138 Is std::vector copying the objects with a push_back? 2010-02-16T17:54:45.227

138 How to initialize std::vector from C-style array? 2010-03-12T16:37:08.943

138 C++ equivalent of StringBuffer/StringBuilder? 2010-03-17T14:20:22.813

137 How to get std::vector pointer to the raw data? 2011-06-26T17:24:34.583

137 What is the purpose of std::make_pair vs the constructor of std::pair? 2012-02-14T01:37:10.673

132 Is the order of iterating through std::map known (and guaranteed by the standard)? 2011-10-04T13:35:23.027

129 What happens if you call erase() on a map element while iterating from begin to end? 2008-11-05T00:02:56.567

126 When vectors are allocated, do they use memory on the heap or the stack? 2011-11-07T12:25:35.093

124 fast way to copy one vector into another 2009-03-13T21:23:28.600

124 What does iterator->second mean? 2013-03-16T15:54:51.857

120 Why is a C++ Vector called a Vector? 2009-02-24T11:30:53.577

120 How to check if std::map contains a key without doing insert? 2010-10-07T23:13:21.100

120 How do I reverse a C++ vector? 2012-01-16T08:44:30.263

118 How do I remove an item from a stl vector with a certain value? 2008-09-02T16:14:13.170

118 How do I specify a pointer to an overloaded function? 2010-05-31T08:55:21.650

116 Deleting elements from STL set while iterating 2010-05-20T14:03:53.927

114 How to reuse an ostringstream? 2009-03-08T20:53:24.247

111 How do I sort a vector of pairs based on the second element of the pair? 2008-11-11T02:41:23.187

110 what is the difference between const_iterator and iterator? 2011-03-18T00:45:11.993

108 Writing your own STL Container 2011-10-13T18:17:24.297

104 Why is it OK to return vector from function? 2014-03-26T08:18:53.137

103 How to overload std::swap() 2008-08-14T19:24:17.260

103 Parsing a comma-delimited std::string 2009-12-12T22:21:56.993

100 remove_if equivalent for std::map 2009-04-29T05:05:30.707

99 What is the difference between const_iterator and non-const iterator in the C++ STL? 2008-11-21T17:36:25.023

96 Is gcc std::unordered_map implementation slow? If so - why? 2012-07-23T14:03:06.253

94 Iterate keys in a C++ map 2009-09-18T10:45:03.927

92 C++ map access discards qualifiers (const) 2008-11-04T18:29:43.540

92 How to set initial size of std::vector? 2012-07-12T17:45:30.353

92 Why does std::set not have a "contains" member function? 2017-03-01T13:04:16.677

90 How do I safely pass objects, especially STL objects, to and from a DLL? 2014-04-01T21:40:10.443

89 Where can I get a "useful" C++ binary search algorithm? 2009-01-15T10:34:46.217

87 How can I create Min stl priority_queue? 2010-03-13T17:35:21.520

85 Erasing elements from a vector 2008-12-07T10:10:20.037

85 std::string comparison (check whether string begins with another string) 2009-05-31T10:44:14.503

84 What exception classes are in the standard C++ library 2012-08-13T17:06:35.613

83 How do you copy the contents of an array to a std::vector in C++ without looping? 2008-11-03T17:03:46.273

82 std::map insert or std::map find? 2008-09-18T21:14:26.307

81 Alternative to vector<bool> 2009-03-22T00:20:59.583

81 Why do I need std::get_temporary_buffer? 2010-07-16T11:25:38.520

81 Preferred/idiomatic way to insert into a map 2010-11-26T15:48:28.737

81 Can't include C++ headers like vector in Android NDK 2011-02-04T00:36:30.140

81 Does the range-based 'for' loop deprecate many simple algorithms? 2013-01-10T13:13:47.370

81 Why doesn't std::queue::pop return value.? 2014-07-30T11:29:47.443

80 string c_str() vs. data() 2008-10-11T20:59:19.783

80 Inspecting standard container (std::map) contents with gdb 2009-01-09T10:13:00.717

80 Recommended way to insert elements into map 2011-08-05T06:49:04.803

78 C++ Double Address Operator? (&&) 2010-12-28T20:14:10.910

77 Why does std::stack use std::deque by default? 2008-09-19T14:50:23.840

77 how-to initialize 'const std::vector<T>' like a c array 2008-10-23T20:54:59.707

77 how to provide a swap function for my class? 2011-06-17T02:51:22.397