4 ms·
These kinds of replies are the bane of interesting discussions because they're aggressive and don't contain any information... What is someone that is unfamilia
by blub 5y ago
These kinds of replies are the bane of interesting discussions because they're aggressive and don't contain any information... What is someone that is unfamiliar with the C++ standard library left with after reading it? At most an uneasy feeling, which is not based on any facts.
So here are some facts:
* A good reference for the C++ standard library is https://en.cppreference.com https://en.cppreference.com
* The standard library is not as large as .NET or Java, but it covers many essential concepts of which the containers and algorithms are the best known. Besides classics like doubly-linked lists, dynamic arrays (std::vector) or maps, there's also sets, a singly-linked list, stack, queue and priority queue. All data structures have complexity guarantees defined in the C++ standard, which is surprisingly very rare for programming languages.
* The algorithms include sorting and searching but don't stop for example at a simple sort and instead also include a partial and stable sort. Besides binary search and linear search, there's also functions like https://en.cppreference.com/w/cpp/algorithm/lower_bound https://en.cppreference.com/w/cpp/algorithm/lower_bound or https://en.cppreference.com/w/cpp/algorithm/equal_range https://en.cppreference.com/w/cpp/algorithm/equal_range and several functions for working with heaps, such as make_heap, push_heap, etc. Other interesting algorithms include those for permutations, counting, working with ranges and modifier functions like rotate, sample or random_shuffle. C++ offers a world-class algorithms library.
* The numeric library offers support for many pseudo-random number generation algorithms, and many distributions (https://en.cppreference.com/w/cpp/numeric/random https://en.cppreference.com/w/cpp/numeric/random). There are dozens of usual (https://en.cppreference.com/w/cpp/numeric/math https://en.cppreference.com/w/cpp/numeric/math) and less usual (https://en.cppreference.com/w/cpp/numeric/special_functions https://en.cppreference.com/w/cpp/numeric/special_functions) mathematical functions in there.
* For systems programming there's the date and time utilities, file system, threads and atomics.
* Although standard for most languages at this point, C++ does offer regular expression support in the standard library.
* Many other smaller types and functions such as tuples, complex numbers, a modern union type (std::variant), streams, etc.
When the above is not enough, there's boost, a series of high-quality libraries with a long history which are like an extension of the standard library. My personal favorites from boost include state machines, graphs, numeric conversions, logging, program options, signals (subject-observer implementation) and ASIO for all sorts of IO.
But there's tons of stuff in there, from additional algorithms and containers to JSON parsers to HTTP and web sockets, from process and shared object management to userland threads, IPC, lockfree data structures and so on and so forth.
And if that's still not enough, there's almost certainly another library for it. C++ is one of the most popular programming languages out there and it has decades of history behind it.