mardi 25 juillet 2017

How to see values of std::list in CLion debugger

I cannot see values of my std::list in CLion debugger (CLion version 2017.2). For example, Look at the following code;

int main()
{
    int myArray[4] = {0,9,8,7};
    std::vector<int> myVec(4);
    std::list<int> myList(4);
    return 0;
}

If you run this code in debug mode, you can see values of std::vector and array but not std::list. What's the solution except getting an iterator for my list (e.g "it") and add a watch for "*it" in watch window like below;

for (auto it=myList.begin(); it != myList.end(); ++it)
    {
      ...
    }

Aucun commentaire:

Enregistrer un commentaire