{"action":"created","issue":{"url":"https://api.github.com/repos/msgpack/msgpack-c/issues/480","repository_url":"https://api.github.com/repos/msgpack/msgpack-c","labels_url":"https://api.github.com/repos/msgpack/msgpack-c/issues/480/labels{/name}","comments_url":"https://api.github.com/repos/msgpack/msgpack-c/issues/480/comments","events_url":"https://api.github.com/repos/msgpack/msgpack-c/issues/480/events","html_url":"https://github.com/msgpack/msgpack-c/issues/480","id":159096209,"number":480,"title":"Difference between object.convert and object.as functions","user":{"login":"mowaiskhan","id":1655331,"avatar_url":"https://avatars.githubusercontent.com/u/1655331?v=3","gravatar_id":"","url":"https://api.github.com/users/mowaiskhan","html_url":"https://github.com/mowaiskhan","followers_url":"https://api.github.com/users/mowaiskhan/followers","following_url":"https://api.github.com/users/mowaiskhan/following{/other_user}","gists_url":"https://api.github.com/users/mowaiskhan/gists{/gist_id}","starred_url":"https://api.github.com/users/mowaiskhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mowaiskhan/subscriptions","organizations_url":"https://api.github.com/users/mowaiskhan/orgs","repos_url":"https://api.github.com/users/mowaiskhan/repos","events_url":"https://api.github.com/users/mowaiskhan/events{/privacy}","received_events_url":"https://api.github.com/users/mowaiskhan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-08T07:23:19Z","updated_at":"2016-06-08T08:57:31Z","closed_at":null,"body":"Hello,\r\n\r\nI am trying to understand source and behavior so kindly bear with me for very basic questions.\r\n\r\nI observed something with below functions\r\n\r\n        msgpack::unpacked unp;\r\n        msgpack::unpack(unp, ss.str().data(), ss.str().size());\r\n        msgpack::object obj = unp.get();\r\n\r\nWhen I call below chunk of code to get my custom defined object back, my class' constructors are called and new object is constructed and then values are assigned to it.\r\n        g = obj.as<gps_position>();\r\n\r\nWhen I call below chunk of code to get my custom defined object back, my class' constructors are not called, only values I serialized are overwritten in object I passed to .convert function.\r\n        obj.convert(g);\r\n\r\nI tried to debug with Eclipse but couldn't reach the bottom of the issue, I will appreciate help.\r\n\r\nThanks & Regards,\r\nOwais."},"comment":{"url":"https://api.github.com/repos/msgpack/msgpack-c/issues/comments/224529881","html_url":"https://github.com/msgpack/msgpack-c/issues/480#issuecomment-224529881","issue_url":"https://api.github.com/repos/msgpack/msgpack-c/issues/480","id":224529881,"user":{"login":"redboltz","id":275959,"avatar_url":"https://avatars.githubusercontent.com/u/275959?v=3","gravatar_id":"","url":"https://api.github.com/users/redboltz","html_url":"https://github.com/redboltz","followers_url":"https://api.github.com/users/redboltz/followers","following_url":"https://api.github.com/users/redboltz/following{/other_user}","gists_url":"https://api.github.com/users/redboltz/gists{/gist_id}","starred_url":"https://api.github.com/users/redboltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redboltz/subscriptions","organizations_url":"https://api.github.com/users/redboltz/orgs","repos_url":"https://api.github.com/users/redboltz/repos","events_url":"https://api.github.com/users/redboltz/events{/privacy}","received_events_url":"https://api.github.com/users/redboltz/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T08:57:31Z","updated_at":"2016-06-08T08:57:31Z","body":"@mowaiskhan, I don't understand what the question is. `msgpacl::object::as()` creates a new instance of the converted to type. `as()` requires a template argument. Try `obj.as<your_clas>()`.\r\n`msgpack::convert()` overwrites the given argument. The type of argument is deduced.\r\n\r\n\r\n"}}
{"actor":{"display_login":"redboltz"}}