I'm quite confused by this paradox:
GCC
ext
apparently contains lots of broadly useful functionality. For example,ext/pb_ds/assoc_container.h
lets you build an order statistic tree just by specifying particular template arguments, andext/numeric
contains thepower(..)
algorithm for O(lg N) exponentiation of a generic object to a non-zero integer power — this algorithm gets written from scratch all the time. There is also the rope data structure, algorithms for random sampling, and many others. Not things you would use every day, but definitely things that would be handy every other year or so.Almost nobody seems to be using them. There is very little discussion on the web. There are some bug reports, and posts like this one suggesting either that these things are buggy and unmaintained or that there is no definitive guide on how to use them properly.
Now, trying to find the documentation, I type in gcc "ext"
into Google, and get https://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/
as the first result. Going to Examples of Associate Containers
gets me to another table of contents, but clicking on e.g. the link to basic_set.cc
gives me a 404 page.
At this point I'm not even sure if this code had received enough testing to be able to rely on it for serious applications.
Is there any proper documentation for when and how to use #include <ext/numeric>
and the like? Or at least examples and asymptotic complexity estimates?