The STL is a critical piece of the C++ world, most implementations derive from the initial efforts by Stepanov and Musser.
My question is given the criticality of the co
Variable names for the reason that this is standard library code, and it should use reserved names for implementation details in headers. The following should not break the standard libraries:
#define mid
#include
So standard library headers can't use mid
as a variable name, hence _Mid
. The STL was different - it wasn't part of the language specification, it was defined as "here are some headers, use them as you will"
Your code or mine, on the other hand, would be invalid if it used _Mid
as a variable name since that's a reserved name - the implementation is allowed to do:
#define _Mid
if it feels like it.
Layout - meh. They probably have a style guide, they probably follow it, more or less. The fact that it doesn't match my style guide (and hence would fail my code review) is nothing to them.
Operators that are difficult to work out - difficult to whom? Code should be written for the people who maintain it, and GNU/Dinkumware/whoever probably don't want to let people loose on the standard libraries who can't puzzle out *--_Next
at a glance. If you use that sort of expression, you get used to it, and if you don't you'll continue finding it hard.
I will give, you, though, that operator()
overload is gibberish. [Edit: I get it, it's a linear congruential generator, done very generically, and if the modulus is "0" that means just use the natural wraparound of the arithmetic type.]