{"action":"created","issue":{"url":"https://api.github.com/repos/dropbox/djinni/issues/159","labels_url":"https://api.github.com/repos/dropbox/djinni/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/dropbox/djinni/issues/159/comments","events_url":"https://api.github.com/repos/dropbox/djinni/issues/159/events","html_url":"https://github.com/dropbox/djinni/pull/159","id":115505560,"number":159,"title":"improved specialized hash function","user":{"login":"skypjack","id":1812216,"avatar_url":"https://avatars.githubusercontent.com/u/1812216?v=3","gravatar_id":"","url":"https://api.github.com/users/skypjack","html_url":"https://github.com/skypjack","followers_url":"https://api.github.com/users/skypjack/followers","following_url":"https://api.github.com/users/skypjack/following{/other_user}","gists_url":"https://api.github.com/users/skypjack/gists{/gist_id}","starred_url":"https://api.github.com/users/skypjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skypjack/subscriptions","organizations_url":"https://api.github.com/users/skypjack/orgs","repos_url":"https://api.github.com/users/skypjack/repos","events_url":"https://api.github.com/users/skypjack/events{/privacy}","received_events_url":"https://api.github.com/users/skypjack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-11-06T13:33:43Z","updated_at":"2015-11-07T06:51:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dropbox/djinni/pulls/159","html_url":"https://github.com/dropbox/djinni/pull/159","diff_url":"https://github.com/dropbox/djinni/pull/159.diff","patch_url":"https://github.com/dropbox/djinni/pull/159.patch"},"body":"The specializations for the function `std::hash` due to the generated `enum`s are difficult to maintain, for updating the underlying type requires several changes to the file `CppGenerator.scala`; moreover, it's not possible to let the users to declare their own underlying types as long as the latter are hardcoded in the generated functions (that would be a good feature indeed, so why not look forward to it?).\r\nThe patch introduces `std::underlying_type` to free the generated functions from the actual underlying types of the `enum`s.\r\nTo include `type_traits` is mandatory to use `std::underlying_type`.\r\nIn addition, the default type for `enum`s has been changed to `unsigned int`, for it looks more suitable to the way `djinni` uses those `enum`s.\r\n\r\nThe file `.gitignore` has been updated to exclude any file generated by qtcreator.\r\nIt would help having those line in that file for future contributions. Thank you."},"comment":{"url":"https://api.github.com/repos/dropbox/djinni/issues/comments/154640737","html_url":"https://github.com/dropbox/djinni/pull/159#issuecomment-154640737","issue_url":"https://api.github.com/repos/dropbox/djinni/issues/159","id":154640737,"user":{"login":"artwyman","id":1761206,"avatar_url":"https://avatars.githubusercontent.com/u/1761206?v=3","gravatar_id":"","url":"https://api.github.com/users/artwyman","html_url":"https://github.com/artwyman","followers_url":"https://api.github.com/users/artwyman/followers","following_url":"https://api.github.com/users/artwyman/following{/other_user}","gists_url":"https://api.github.com/users/artwyman/gists{/gist_id}","starred_url":"https://api.github.com/users/artwyman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artwyman/subscriptions","organizations_url":"https://api.github.com/users/artwyman/orgs","repos_url":"https://api.github.com/users/artwyman/repos","events_url":"https://api.github.com/users/artwyman/events{/privacy}","received_events_url":"https://api.github.com/users/artwyman/received_events","type":"User","site_admin":false},"created_at":"2015-11-07T06:51:47Z","updated_at":"2015-11-07T06:51:47Z","body":"I'm not sure I have full context, but I think I'm +1 in favor of implementing the feature you really need, not a different feature which makes your workaround easier.  I'd be in favor of a flag to change the underlying type for enums if you find it useful, and that would have minimal impact on anyone not using the feature."}}