{"action":"created","issue":{"url":"https://api.github.com/repos/krabicezpapundeklu/smart_enum/issues/2","labels_url":"https://api.github.com/repos/krabicezpapundeklu/smart_enum/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/krabicezpapundeklu/smart_enum/issues/2/comments","events_url":"https://api.github.com/repos/krabicezpapundeklu/smart_enum/issues/2/events","html_url":"https://github.com/krabicezpapundeklu/smart_enum/issues/2","id":126215312,"number":2,"title":"To/from string support","user":{"login":"quicknir","id":10457096,"avatar_url":"https://avatars.githubusercontent.com/u/10457096?v=3","gravatar_id":"","url":"https://api.github.com/users/quicknir","html_url":"https://github.com/quicknir","followers_url":"https://api.github.com/users/quicknir/followers","following_url":"https://api.github.com/users/quicknir/following{/other_user}","gists_url":"https://api.github.com/users/quicknir/gists{/gist_id}","starred_url":"https://api.github.com/users/quicknir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicknir/subscriptions","organizations_url":"https://api.github.com/users/quicknir/orgs","repos_url":"https://api.github.com/users/quicknir/repos","events_url":"https://api.github.com/users/quicknir/events{/privacy}","received_events_url":"https://api.github.com/users/quicknir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-12T16:19:41Z","updated_at":"2016-01-13T04:56:36Z","closed_at":null,"body":"There's a couple of related points here. First, it would be good to have some kind of conversion function that goes from string to an enum. Second, a couple of thoughts on the to-string interface, currently given by description. The name: could description be changed to something more idiomatic like to_string? Also, this is possibly related: what's the use case for allowing a description different from the name of the enum? Since the name of the enum doesn't actually affect the code at all, it seems like this adds more complexity and potential confusion for little benefit. The only application I see is to handle either \"scoped\" or unscoped names, but this could be handled by a trait or different to_string functions (or booleans)."},"comment":{"url":"https://api.github.com/repos/krabicezpapundeklu/smart_enum/issues/comments/171167896","html_url":"https://github.com/krabicezpapundeklu/smart_enum/issues/2#issuecomment-171167896","issue_url":"https://api.github.com/repos/krabicezpapundeklu/smart_enum/issues/2","id":171167896,"user":{"login":"quicknir","id":10457096,"avatar_url":"https://avatars.githubusercontent.com/u/10457096?v=3","gravatar_id":"","url":"https://api.github.com/users/quicknir","html_url":"https://github.com/quicknir","followers_url":"https://api.github.com/users/quicknir/followers","following_url":"https://api.github.com/users/quicknir/following{/other_user}","gists_url":"https://api.github.com/users/quicknir/gists{/gist_id}","starred_url":"https://api.github.com/users/quicknir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicknir/subscriptions","organizations_url":"https://api.github.com/users/quicknir/orgs","repos_url":"https://api.github.com/users/quicknir/repos","events_url":"https://api.github.com/users/quicknir/events{/privacy}","received_events_url":"https://api.github.com/users/quicknir/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T04:56:36Z","updated_at":"2016-01-13T04:56:36Z","body":"Cool stuff! This is great timing for me, I was looking for something like this. I evaluated a few libraries, but they were all much more invasive and doing things in non-optimal ways for better backwards compatibility (e.g. typesafe enums for C++03). I was basically resigned to doing things myself from scratch, but this is fantastic, looking forward to digging into the implementation."}}