What is the meaning of this piece of Standardese about shared_ptr's use_count()?

前端 未结 3 1475
伪装坚强ぢ
伪装坚强ぢ 2021-01-07 17:41

While trying to wrap my head around the problem shown in this question I found myself stuck on the following sentence from [util.smartptr.shared]/4:

[

3条回答
  •  执念已碎
    2021-01-07 17:58

    It means that the code in use_count() is either lock-free or uses mutexs to lock critical sections. In other words you can call it from threads without worring about race conditions.

提交回复
热议问题