Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Which statement about std::shared_ptr's reference count is correct?

  1. A It is updated atomically, which has a measurable cost
  2. B It is not thread-safe
  3. C It is stored inside the managed object
  4. D It never decrements
Answer

It is updated atomically, which has a measurable cost

The atomic count makes shared_ptr safe to copy across threads but slower than unique_ptr, so it should be used only when ownership is genuinely shared.

All C++ MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as