2 ms·
Reading the c++ stdlib source code is never a good idea.
by stathibus 5y ago
Reading the c++ stdlib source code is never a good idea.
- FpUser 5y agoROFL. Yup. When I look at application level codes those are nice. Looking at stdlib makes me want to walk away immediately.
- einpoklum 5y agoIt's not a fun experience to be sure, but: 1. It's useful when you want to check the exact under-the-hood behavior, to figure out side-effects or corner-case semantics. 2. After a good number of years, that code becomes less scary and more icky. Some of it remains kind of scary though... 3. Reading that code teaches you a lot about considerations you may be ignoring, especially your implicit platform-dependent assumptions. 4. Nitpick: There isn't any single C++ standard library source code, it's at least 3 popular ones (GCC's libstdc++, LLVM's libc++, and Microsoft's)