C++11, the STL, and why all C++ developers should learn them
- Locked due to inactivity on Aug 4, '16 4:33pm
Thread Topic: C++11, the STL, and why all C++ developers should learn them
-
C++11 doesn't do much without STL, using them together creates a much better c++ which is easier to use and often faster. One of my big gripes with c++ is data structures. I want comolex data structires with children, parents, and all kinds of complexities and be able to use and edit them quickly. Using vectors you have a quick and easy solution to easy and fast collections of data, just push_back to add objects and can access values like normal arrays. It doesn't get much easier. With a set you can keep an order vector like object but with no repeats, and you can define how it sorts the data. All of these types ise templates to make them versatile and easily customizable. Other features of STL are algorithms. I'll admit I need to look into them more but one I use often is sort, it will sort almost any type of list you want (arrays, vectors, maps, etc) in snappy time. And you can define how it sorts them. Now is where c++11 comes in, you can use lambdas now to define how it sorts them and lambdas are much more powerful then function pointers. And finally for loops which iterate over lists like vectors and sets, these don't work for arrays but you will hopefully be usimg STL types more so they will often work for simple tasks like printing a vector or adding all the values in a set of pairs.
So go learn STL and c++11 kids >.>
This thread is locked, therefore no new posts can be made.