{"action":"opened","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/179","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/179/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/179/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/179","id":108567450,"number":179,"title":"Taxonomy of ownership semantics","user":{"login":"miyuki-chan","id":4668268,"avatar_url":"https://avatars.githubusercontent.com/u/4668268?v=3","gravatar_id":"","url":"https://api.github.com/users/miyuki-chan","html_url":"https://github.com/miyuki-chan","followers_url":"https://api.github.com/users/miyuki-chan/followers","following_url":"https://api.github.com/users/miyuki-chan/following{/other_user}","gists_url":"https://api.github.com/users/miyuki-chan/gists{/gist_id}","starred_url":"https://api.github.com/users/miyuki-chan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miyuki-chan/subscriptions","organizations_url":"https://api.github.com/users/miyuki-chan/orgs","repos_url":"https://api.github.com/users/miyuki-chan/repos","events_url":"https://api.github.com/users/miyuki-chan/events{/privacy}","received_events_url":"https://api.github.com/users/miyuki-chan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-27T23:28:01Z","updated_at":"2015-09-27T23:28:01Z","closed_at":null,"body":"The Core Guidelines say much about pointers, resources and ownership semantics, so I think it would be nice to provide a similar taxonomy for pointers, references and other objects with similar (pointer-like) semantics. I mean something like the taxonomy of value categories in [basic.lval], but, if possible, without overlaps. For example:\r\n* Reference to resource (in general sense) ??? - need a better term\r\n  * owning reference - determines lifetime of the object referred\r\n    * collection\r\n    * unique_ptr\r\n    * `owner<T*>`\r\n    * rvalue-reference (when used with std::move)\r\n  * shared_ptr - partially determines lifetime\r\n  * weak_ptr - does not determine lifetime, but provides an interface to check validity\r\n  * view - does not determine lifetime, will cause undefined behavior if object is accessed via a view after end of it's lifetime\r\n    * string_view, array_view, etc.\r\n    * iterator\r\n    * lvalue reference\r\n    * raw pointer"}}