gpt4 book ai didi

c++ - 在 Visual Studio 中调试时的 Px、Pn

转载 作者:行者123 更新时间:2023-11-30 02:40:32 27 4
gpt4 key购买 nike

在 Visual Studio 中调试 C++ 时,如果将监视添加到对象上,您会看到“px”和“pn”作为其直接子项。

我一直将“px”理解为指向实际对象的指针,但我很好奇这些“px”、“pn”和“pi”代码实际上是什么的缩写?

最佳答案

我想你看到的是 boost::shared_ptr 实例的内容,它确实包含 pxpn 成员:

element_type * px;                 // contained pointer
boost::detail::shared_count pn; // reference counter

因此,这些不是某种神奇的调试器变量,而是真正的类字段,您不会在常规对象中看到它们。

关于c++ - 在 Visual Studio 中调试时的 Px、Pn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28853883/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com