Boost library? It is generally believed that written C ++ code of the highest quality is written. (Many of them are also more or less unreadable if you yourself are not a C ++ guru)
In general, I would advise you to be careful with this approach. In C ++, the source code will probably not be as informative as in many other languages.
If you see some kind of Python code, you can pretty much consider it correct while it works. If it is written by someone who seems to know what they are doing, you can even assume that it is well written.
In C ++, there are just a lot of nasty traps and subtle exceptions for every rule that you really need to know what you are doing. Switching to what compiles or works, or what you saw in other source code, is dangerous and to a large extent guarantees that you will sooner or later end up with a program that relies on undefined behavior and will work when you least expect it .
If I were you, I would try to stick with books. There are some very well written ones that, in addition to seeing some source code, also teach you the “correct” language. And while you adhere to authoritative authors, you will be convinced that they will not teach you any bad habits or will not render you in an intolerable code.
jalf
source share