{"action":"created","issue":{"url":"https://api.github.com/repos/ceph/ceph/issues/7303","labels_url":"https://api.github.com/repos/ceph/ceph/issues/7303/labels{/name}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/7303/comments","events_url":"https://api.github.com/repos/ceph/ceph/issues/7303/events","html_url":"https://github.com/ceph/ceph/pull/7303","id":127799445,"number":7303,"title":"add custom move operations for ObjectStore::Transaction","user":{"login":"cbodley","id":1928002,"avatar_url":"https://avatars.githubusercontent.com/u/1928002?v=3","gravatar_id":"","url":"https://api.github.com/users/cbodley","html_url":"https://github.com/cbodley","followers_url":"https://api.github.com/users/cbodley/followers","following_url":"https://api.github.com/users/cbodley/following{/other_user}","gists_url":"https://api.github.com/users/cbodley/gists{/gist_id}","starred_url":"https://api.github.com/users/cbodley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbodley/subscriptions","organizations_url":"https://api.github.com/users/cbodley/orgs","repos_url":"https://api.github.com/users/cbodley/repos","events_url":"https://api.github.com/users/cbodley/events{/privacy}","received_events_url":"https://api.github.com/users/cbodley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ceph/ceph/labels/core","name":"core","color":"0052cc"},{"url":"https://api.github.com/repos/ceph/ceph/labels/needs-qa","name":"needs-qa","color":"fad8c7"},{"url":"https://api.github.com/repos/ceph/ceph/labels/wip-sage-testing2","name":"wip-sage-testing2","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-20T22:29:43Z","updated_at":"2016-01-21T08:28:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/7303","html_url":"https://github.com/ceph/ceph/pull/7303","diff_url":"https://github.com/ceph/ceph/pull/7303.diff","patch_url":"https://github.com/ceph/ceph/pull/7303.patch"},"body":"I wrote up a quick unit test to make sure that ObjectStore::Transaction's default move operations were doing what we expected them to, and it turns out that they weren't.\r\n\r\nWhat I learned is that the compiler treats plain-old-data types specially when generating their default move operations. Because the builtin types don't have default initial values, it reverts to a normal copy and makes no effort to restore the source object to default values. See 'Trivial move constructor' at http://en.cppreference.com/w/cpp/language/move_constructor for more information.\r\n\r\nI added a custom move constructor and move assignment operator to TransactionData that does restore the default values, and the unit tests pass as expected."},"comment":{"url":"https://api.github.com/repos/ceph/ceph/issues/comments/173494995","html_url":"https://github.com/ceph/ceph/pull/7303#issuecomment-173494995","issue_url":"https://api.github.com/repos/ceph/ceph/issues/7303","id":173494995,"user":{"login":"tchaikov","id":59071,"avatar_url":"https://avatars.githubusercontent.com/u/59071?v=3","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T08:28:36Z","updated_at":"2016-01-21T08:28:36Z","body":"lgtm"}}