c++pythonstandard-librarystd

C / C++ equivalents to the Python Standard Library


I depend heavily on Python's standard library, both for useful data structures and manipulators (e.g., collections and itertools) and for utilities (e.g., optparse, json, and logging), to skip the boilerplate and just Get Things Done. Looking through documentation on the C++ standard library, it seems entirely about data structures, with little in the way of the "batteries included" in Python's standard library.

The Boost library is the only open-source C++ library collection I know of that resembles the Python standard library, however while it does have utility libraries such as Regular Expression support, most of it is also dedicated to data structures. I'm just really surprised that even something as simple as assured parsing and writing a CSV file, made delightfully simple with the Python csv module, looks to require rolling-your-own in C++ (even if you leverage some parsing library by Boost).

Are there other open-source libraries out there for C++ that provide "batteries"? If not, what do you do as a C++ programmer: hunt for individual utility libraries (and if so, how), or just roll your own (which seems annoying and wasteful)?


Solution

  • The Poco library is more like other languages' standard libraries.

    Actually the Poco web site's logo says "C++ now comes with batteries included!", which seems to be precisely what you're asking for.

    I didn't like it when I tried because I found it too C-like and with too many dependencies between parts (difficult to single out just the functionality you want).

    But there are many people & firms using it, so it seems I'm in minority and you will perhaps find it very useful.

    In addition, as others have mentioned, for data structures, parsers, and indeed an interface to Python!, and such stuff, check out Boost.

    Cheers & hth.,