I would not recommend anyone ever look through that as a way to learn C++. Heck just something as basic as a struct that stores two member variables is a 200 line of code horror show in C++:
No, in C++, a pair of member variables is what I wrote.
C++ has enough complexity already, there's no need for you to add additional false claims. The thing you pointed to is the standard library version of std::pair, written to be as platform-independent, performant and correct as possible. But if, as a programmer, you need a 'simple struct with two elements', as you described it, you just define a struct and add the two elements, and that's it. Or you just declare it as std::pair<int, int>.
Your statement that declaring a struct with two members in C++ takes 200 lines is just completely false.
You are completely ignoring the context of this discussion to make an irrelevant point and doing it in a way that ironically supports my position.
If one wishes to learn how to represent a pair of values in a generic, cross platform and efficient manner, one should NOT consult the standard library to learn such a thing precisely because the standard library includes incredibly irrelevant and archaic details that are entirely unneeded to understand how to idiomatically represent a pair of values.
Your claim that the standard library is written to be cross platform couldn't be further from the truth. The standard library is written to work with a specific compiler, and often times only with a specific version of a compiler on a specific platform. While it's possible to use libstdc++ with clang, it's not possible to use libc++ with GCC. Furthermore no compiler other than MSVC fully supports MSSTL.
The idea that the C++ standard library is a good way to understand in concrete and idiomatic terms how to represent a generic pair of values is simply bad advice.
If you wish to counter that position then you are welcome to do so, but so far you are arguing something entirely different from the actual topic at hand. The argument I'm making isn't that you need 200 lines of code to represent a pair of values, it's that if you tried to understand how to represent a pair of values by consulting the standard library, you'd need to sift through 200 lines of code because the standard library is written in an incredibly complex manner that is entirely unnecessary in order to learn or understand idiomatic C++.
In short, the statement " To learn a new language, read its standard library", is bad advice for someone who is new to learning C++.
Well, that's still instructive about how library code that aims to be efficient and portable has to look in C++. It's not representative of most application / business layer code, and it's definitely not good learning material.
But, if choosing C++, at some point you will have to write code like that as a project matures and must target different compiler versions and platforms.
No, at no point should you use the standard library to understand how to write C++ code. The standard library has a specific clause in the C++ standard that exempts it from rules about undefined behavior. For example, that link I pasted to implement a std::vector is not something that is permissible to use by non-standard library code, it is full of undefined behavior that is permissible for use by the standard library but not permissible for use by ordinary code.
To the extent that one can learn how to write cross-platform efficient and generic C++ code, there is always a better example to learn from than the standard library.
struct foo { int a; int b; };
That's all. The thing you refer to is not a 'basic struct', it's complex standard library component.