I'm running Visual Studio Enterprise 2015, version 14.0.23107.0 D14REL.
When debugging a C++ program I cannot see the contents of STL containers.
I've got the "Show raw structure of objects in variables windows" option unchecked (Tools->Options->Debugging->General).
Here's an example that illustrates the problem:
#include <list> #include <string> #include <vector> int main() { std::string string = "test"; std::vector<int> vector{ 4, 5, 6 }; std::list<std::string> list{ "one", "two", "three" }; return 0; }
In the Locals or Watch windows I see the following:
list [...]() vector [...](... (error) 0 (error) 0 string {npos=4294967295} (error) 0 (error) 0
If I then check the "Show raw structure..." option, I can correctly drill down into the vector and string objects, but still not the list!
Is there another option that I've missed, or is this a genuine bug in VS?
@BjörnPollex Yes! I forgot to mention that.
An STL container is a collection of objects of the same type (the elements). Container owns the elements. Creation and destruction is controlled by the container.
In C++, STL Unordered Associative Containers provide the unsorted versions of the associative container. Internally, unordered associative containers are implemented as hash table data structures.
I had a same problem.
You need to go into Tools->Options->Debugging->General and uncheck both "Use Managed Compability Mode" and "Use Native Compability Mode".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With