{"comment":{"url":"https://api.github.com/repos/miguelportilla/rippled/comments/13994748","html_url":"https://github.com/miguelportilla/rippled/commit/0af1747388007ebadc87da7bfef6faa9138c1712#commitcomment-13994748","id":13994748,"user":{"login":"scottschurr","id":7840379,"avatar_url":"https://avatars.githubusercontent.com/u/7840379?v=3","gravatar_id":"","url":"https://api.github.com/users/scottschurr","html_url":"https://github.com/scottschurr","followers_url":"https://api.github.com/users/scottschurr/followers","following_url":"https://api.github.com/users/scottschurr/following{/other_user}","gists_url":"https://api.github.com/users/scottschurr/gists{/gist_id}","starred_url":"https://api.github.com/users/scottschurr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottschurr/subscriptions","organizations_url":"https://api.github.com/users/scottschurr/orgs","repos_url":"https://api.github.com/users/scottschurr/repos","events_url":"https://api.github.com/users/scottschurr/events{/privacy}","received_events_url":"https://api.github.com/users/scottschurr/received_events","type":"User","site_admin":false},"position":28,"line":28,"path":"src/ripple/core/JobCoro.h","commit_id":"0af1747388007ebadc87da7bfef6faa9138c1712","created_at":"2015-10-26T20:27:11Z","updated_at":"2015-10-26T20:27:11Z","body":"There's clearly an expected use model going on here.  You're not supposed to call `shared_from_this()` unless a `shared_ptr` already exists.  So I'm guessing that you expect the caller to *always* put the constructed `JobCoro` in a `shared_ptr`.  Otherwise blindly calling `shared_from_this` in `resume()` would not be safe.\r\n\r\nSo my inclination would be to a) document the expected usage model with a comment and b) use the compiler to help enforce the usage model.  If I'm right that a `JobCoro` always goes in a shared_ptr, then one approach might be to make the constructor private and make `std::make_shared` a friend."}}