{"action":"created","issue":{"url":"https://api.github.com/repos/USCiLab/cereal/issues/360","repository_url":"https://api.github.com/repos/USCiLab/cereal","labels_url":"https://api.github.com/repos/USCiLab/cereal/issues/360/labels{/name}","comments_url":"https://api.github.com/repos/USCiLab/cereal/issues/360/comments","events_url":"https://api.github.com/repos/USCiLab/cereal/issues/360/events","html_url":"https://github.com/USCiLab/cereal/issues/360","id":190579590,"number":360,"title":"Archive::{is_loading,is_saving}::value","user":{"login":"headupinclouds","id":554720,"avatar_url":"https://avatars.githubusercontent.com/u/554720?v=3","gravatar_id":"","url":"https://api.github.com/users/headupinclouds","html_url":"https://github.com/headupinclouds","followers_url":"https://api.github.com/users/headupinclouds/followers","following_url":"https://api.github.com/users/headupinclouds/following{/other_user}","gists_url":"https://api.github.com/users/headupinclouds/gists{/gist_id}","starred_url":"https://api.github.com/users/headupinclouds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headupinclouds/subscriptions","organizations_url":"https://api.github.com/users/headupinclouds/orgs","repos_url":"https://api.github.com/users/headupinclouds/repos","events_url":"https://api.github.com/users/headupinclouds/events{/privacy}","received_events_url":"https://api.github.com/users/headupinclouds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-20T19:57:55Z","updated_at":"2016-11-24T00:57:50Z","closed_at":null,"body":"Is the following {`is_loading`,`is_saving`} type addition compatible with the cereal library?  This would greatly improve compatibility with existing boost serialization code and is seemingly unobtrusive.\r\n\r\n```\r\ntemplate<class ArchiveType, std::uint32_t Flags = 0>\r\n  class OutputArchive : public detail::OutputArchiveBase\r\n{\r\n  public:\r\n    typedef bool_<false> is_loading;  // <- proposal\r\n    typedef bool_<true> is_saving;     // <- proposal\r\n   // ...\r\n};\r\n```\r\n\r\nThis supports the following serialization pattern:\r\n\r\n```\r\nstruct Bar\r\n{\r\n    template <typename Archive> void serialize(Archive &ar, const std::uint32_t version)\r\n    {\r\n        std::int16_t tmp = foo;\r\n        if(Archive::is_loading::value)\r\n        {\r\n            ar & tmp;\r\n            foo = tmp; // For illustration only\r\n        }\r\n        else\r\n        {\r\n            tmp = foo; // For illustration only\r\n            ar & tmp;\r\n        }\r\n        ar & foo;\r\n    }\r\n    std::int32_t foo;\r\n};\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/USCiLab/cereal/issues/comments/262665681","html_url":"https://github.com/USCiLab/cereal/issues/360#issuecomment-262665681","issue_url":"https://api.github.com/repos/USCiLab/cereal/issues/360","id":262665681,"user":{"login":"headupinclouds","id":554720,"avatar_url":"https://avatars.githubusercontent.com/u/554720?v=3","gravatar_id":"","url":"https://api.github.com/users/headupinclouds","html_url":"https://github.com/headupinclouds","followers_url":"https://api.github.com/users/headupinclouds/followers","following_url":"https://api.github.com/users/headupinclouds/following{/other_user}","gists_url":"https://api.github.com/users/headupinclouds/gists{/gist_id}","starred_url":"https://api.github.com/users/headupinclouds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headupinclouds/subscriptions","organizations_url":"https://api.github.com/users/headupinclouds/orgs","repos_url":"https://api.github.com/users/headupinclouds/repos","events_url":"https://api.github.com/users/headupinclouds/events{/privacy}","received_events_url":"https://api.github.com/users/headupinclouds/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T00:57:50Z","updated_at":"2016-11-24T00:57:50Z","body":"Thanks for the quick feedback (and a great library).  I will put together a PR over the holiday.  Having this change upstream will greatly simplify a boost -> cereal transition."}}
{"actor":{"display_login":"headupinclouds"}}