boost shared_from_this<>()
问题 could someone summarize in a few succinct words how the boost shared_from_this<>() smart pointer should be used, particularly from the perspective of registering handlers in the io_service using the bind function. EDIT: Some of the responses have asked for more context. Basically, I'm looking for "gotchas", counter-intuitive behaviour people have observed using this mechanism. 回答1: The biggest "gotcha" I've run into is that it's illegal to call shared_from_this from the constructor. This