Namespaces
Variants
Views
Actions

Talk:cpp/memory/enable shared from this/shared from this

From cppreference.com

I suggest the Notes should explicitly say that shared_from_this cannot be used in the constructor that's being called by std::make_shared. That's because I just happened to fall into this pit. 80.187.81.153 09:02, 28 November 2018 (PST)

the notes currently say "only on a previously shared object, i.e. on an object managed by std::shared_ptr" -- it seems peculiar to add such a specific example, though I agree that noting that it bans calling shared_from_this in all constructors is warranted. --Cubbi (talk) 11:08, 28 November 2018 (PST)

The main shared_ptr page explains how you can copy and assign a shared_ptr in multiple threads. Should the shared_from_this() page also state that you can call shared_from_this() from multiple threads in the same way? --Brad Spencer (talk) 12:15, 18 October 2022 (PDT)