Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Microsoft Visual C++ 2015 中,如何在 Boost 共享指针上设置“数据断点”,以便调试器在强和/或弱引用的数量发生变化时中断?
std::shared_ptrVS2015中的控制块有_Uses和_Weaks成员。只需通过它们的监视表达式为这些设置数据断点:例如&(*(ptr)._Rep)._Weaks
std::shared_ptr
_Uses
_Weaks
&(*(ptr)._Rep)._Weaks
这是一个屏幕截图: