1

I'm quite confused by this paradox:

  1. 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, and ext/numeric contains the power(..) 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.

  2. 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?

Community
  • 1
  • 1
Evgeni Sergeev
  • 22,495
  • 17
  • 107
  • 124
  • There is a mirror on github; you can find the policy-based datastructures examples here: https://github.com/gcc-mirror/gcc/tree/master/libstdc%2B%2B-v3/testsuite/ext/pb_ds/example . The URL you found on Google looks to me like it is not current; this one works https://gcc.gnu.org/onlinedocs/libstdc++/manual/policy_data_structures_using.html#pbds.using.examples but the files are not linked (however, they are in the directory on github.) Hope that helps a bit. – rici Sep 05 '15 at 02:08

1 Answers1

1

Since it sounds like you've found a defect in the documentation, I'd suggest sending an e-mail to libstdc++@gcc.gnu.org to subscribe to the mailing list. I was able to find a mirror for the libstdc++ test suite on Github, which contains the examples you want. If you're looking for documentation for ext_numerics, it's at gcc.gnu.org/onlinedocs/libstdc++/manual/ext_numerics.html.

  • To the person who voted to delete my answer, why don't you pay attention to what the OP has an issue with? I posted a working link for the file they were looking for, as well as the documentation for the specific header. – user5302656 Sep 05 '15 at 01:47