The C++ language comes with a standard library. When you’re debugging your C++ code, you may have to go digging inside the implementation to extract information from crash dumps. This mini-series is going to look at how various C++ standard library types are implemented by the three major implementations (clang, gcc, and msvc).
Inside STL: The Pair and The Compressed Pair
By Raymond Chen
From the article:
The C++ language comes with a standard library. When you’re debugging your C++ code, you may have to go digging inside the implementation to extract information from crash dumps. This mini-series is going to look at how various C++ standard library types are implemented by the three major implementations (clang, gcc, and msvc).
We’ll start with the lowly
std::
. Its definition is quite simple.pair template<typename T1, typename T2> struct pair { T1 first; T2 second; };The names of the members of
std::
are required by the C++ language standard, so you don’t see any variation here. Here’s how it looks in the Windows debugger:pair 0:000> ?? t struct std::pair<int,int> +0x000 first : 0n42 +0x004 second : 0n99
Add a Comment
Comments are closed.