{"action":"created","issue":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2496","repository_url":"https://api.github.com/repos/ARMmbed/mbed-os","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2496/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2496/comments","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2496/events","html_url":"https://github.com/ARMmbed/mbed-os/pull/2496","id":172020206,"number":2496,"title":"Add cv-qualifiers to Callback and deprecate combinatorial explody functions","user":{"login":"geky","id":1075160,"avatar_url":"https://avatars.githubusercontent.com/u/1075160?v=3","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20CI","name":"needs: CI","color":"fbca04"},{"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20review","name":"needs: review","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-08-18T22:59:34Z","updated_at":"2016-08-23T15:30:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2496","html_url":"https://github.com/ARMmbed/mbed-os/pull/2496","diff_url":"https://github.com/ARMmbed/mbed-os/pull/2496.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/2496.patch"},"body":"From this discussion https://github.com/ARMmbed/mbed-os/pull/2395 and the related issue https://github.com/ARMmbed/mbed-os/issues/2490\r\n\r\nThe combination of cv-qualifiers with callback overloads results in a large number of overloads to match all possible types that could be passed to the Callback class.\r\n\r\nThis isn't a big problem for `void (*)(cv T *)` function types, but for `void (T::*)() cv` types, the method in which cv-qualifiers are associated prevents encoding the cv-qualifiers in the `T` type, and requiring a large combination of overloads for all cv-qualifiers.\r\n\r\nThis pr involves several changes:\r\n- Adds jinja templates to the Callback header file\r\n- Adds full support for cv-qualifiers in Callback constructor\r\n- Provides convenience `mbed::callback` function to pass different arguments to Callback with infered type.\r\n- Deprecates existing convenience functions to avoid confusion if the user attempts to use a `const` or `volatile` object with the existing convenience functions.\r\n- Updates tests appropriately\r\n\r\nSupported overloads:\r\n``` cpp\r\ncallback(void (*f)(A...));\r\ncallback(const Callback<R(A...)> &);\r\ncallback(T *t,                void (*f)(T*, A...));\r\ncallback(const T *t,          void (*f)(const T*, A...));\r\ncallback(volatile T *t,       void (*f)(volatile T*, A...));\r\ncallback(const volatile T *t, void (*f)(const volatile T*, A...));\r\ncallback(T *t,                void (T::*f)(A...));\r\ncallback(const T *t,          void (T::*f)(A...) const);\r\ncallback(volatile T *t,       void (T::*f)(A...) volatile);\r\ncallback(const volatile T *t, void (T::*f)(A...) const volatile);\r\n```\r\n\r\nShould fix: https://github.com/ARMmbed/mbed-os/issues/2490\r\nReplaces:  https://github.com/ARMmbed/mbed-os/pull/2395 and https://github.com/ARMmbed/mbed-os/pull/2495\r\ncc @pan-, @0xc0170\r\n\r\nLet me know any thoughts/suggestions on this solution you guys have."},"comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments/241771386","html_url":"https://github.com/ARMmbed/mbed-os/pull/2496#issuecomment-241771386","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2496","id":241771386,"user":{"login":"sg-","id":496002,"avatar_url":"https://avatars.githubusercontent.com/u/496002?v=3","gravatar_id":"","url":"https://api.github.com/users/sg-","html_url":"https://github.com/sg-","followers_url":"https://api.github.com/users/sg-/followers","following_url":"https://api.github.com/users/sg-/following{/other_user}","gists_url":"https://api.github.com/users/sg-/gists{/gist_id}","starred_url":"https://api.github.com/users/sg-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sg-/subscriptions","organizations_url":"https://api.github.com/users/sg-/orgs","repos_url":"https://api.github.com/users/sg-/repos","events_url":"https://api.github.com/users/sg-/events{/privacy}","received_events_url":"https://api.github.com/users/sg-/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T15:30:20Z","updated_at":"2016-08-23T15:30:20Z","body":"Not committing the template files. If something needs to change that often to need auto-generation, I don't think its ready for master :)"}}
{"actor":{"display_login":"sg-"}}