{"action":"created","issue":{"url":"https://api.github.com/repos/USCiLab/cereal/issues/209","labels_url":"https://api.github.com/repos/USCiLab/cereal/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/USCiLab/cereal/issues/209/comments","events_url":"https://api.github.com/repos/USCiLab/cereal/issues/209/events","html_url":"https://github.com/USCiLab/cereal/issues/209","id":95687402,"number":209,"title":"explicit versioning with namespaces","user":{"login":"orzechow","id":5220714,"avatar_url":"https://avatars.githubusercontent.com/u/5220714?v=3","gravatar_id":"","url":"https://api.github.com/users/orzechow","html_url":"https://github.com/orzechow","followers_url":"https://api.github.com/users/orzechow/followers","following_url":"https://api.github.com/users/orzechow/following{/other_user}","gists_url":"https://api.github.com/users/orzechow/gists{/gist_id}","starred_url":"https://api.github.com/users/orzechow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzechow/subscriptions","organizations_url":"https://api.github.com/users/orzechow/orgs","repos_url":"https://api.github.com/users/orzechow/repos","events_url":"https://api.github.com/users/orzechow/events{/privacy}","received_events_url":"https://api.github.com/users/orzechow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-17T16:00:52Z","updated_at":"2015-07-21T15:53:13Z","closed_at":null,"body":"How can I use the [explicit versioning functions](http://uscilab.github.io/cereal/serialization_functions.html#versioning) for classes in namespaces?\r\nI have tried both to declare the CEREAL_CLASS_VERSION within or outside of my private namespace, but both versions fail.\r\nSee [this Gist](https://gist.github.com/orzechow/e8066e022571cd82b2a1) for a full, but minimal, example based on the cereal Docs.\r\n\r\nCompiling `cereal_version_test_outside_ns.cpp` returns\r\n\r\n```\r\nIn file included from cereal_version_test_outside_ns.cpp:1:0:\r\nmy_dir/cereal-master/include/cereal/cereal.hpp:207:23: error: ‘CEREAL_CLASS_VERSION_REGISTERmy_cool_namespace’ has not been declared\r\n     static const auto CEREAL_CLASS_VERSION_REGISTER##TYPE##VERSION_NUMBER =      \\\r\n                       ^\r\ncereal_version_test_outside_ns.cpp:34:1: note: in expansion of macro ‘CEREAL_CLASS_VERSION’\r\n CEREAL_CLASS_VERSION( my_cool_namespace::MyCoolClass, 1 );\r\n ^\r\n```\r\n\r\nCompiling `` returns\r\n\r\n```\r\nmy_dir/cereal-master/include/cereal/cereal.hpp:197:24: error: ‘Version’ is not a class template\r\n     template <> struct Version<TYPE>                                             \\\r\n                        ^\r\ncereal_version_test_within_ns.cpp:32:1: note: in expansion of macro ‘CEREAL_CLASS_VERSION’\r\n CEREAL_CLASS_VERSION( MyCoolClass, 1 );\r\n ^\r\nmy_dir/cereal-master/include/cereal/cereal.hpp:198:5: error: explicit specialization of non-template ‘my_cool_namespace::cereal::detail::Version’\r\n     {                                                                            \\\r\n     ^\r\ncereal_version_test_within_ns.cpp:32:1: note: in expansion of macro ‘CEREAL_CLASS_VERSION’\r\n CEREAL_CLASS_VERSION( MyCoolClass, 1 );\r\n ^\r\nmy_dir/cereal-master/include/cereal/cereal.hpp:200:14: error: ‘my_cool_namespace::cereal::detail::Version’ is not a template\r\n       static Version<TYPE> registerVersion()                                     \\\r\n              ^\r\ncereal_version_test_within_ns.cpp:32:1: note: in expansion of macro ‘CEREAL_CLASS_VERSION’\r\n CEREAL_CLASS_VERSION( MyCoolClass, 1 );\r\n ^\r\n...\r\n```\r\n\r\nIt seems to me, that the CEREAL_CLASS_VERSION macro has not been intended for the use with namespaced classes.\r\nThis is basic requirement for such a feature in my opinion."},"comment":{"url":"https://api.github.com/repos/USCiLab/cereal/issues/comments/123382260","html_url":"https://github.com/USCiLab/cereal/issues/209#issuecomment-123382260","issue_url":"https://api.github.com/repos/USCiLab/cereal/issues/209","id":123382260,"user":{"login":"orzechow","id":5220714,"avatar_url":"https://avatars.githubusercontent.com/u/5220714?v=3","gravatar_id":"","url":"https://api.github.com/users/orzechow","html_url":"https://github.com/orzechow","followers_url":"https://api.github.com/users/orzechow/followers","following_url":"https://api.github.com/users/orzechow/following{/other_user}","gists_url":"https://api.github.com/users/orzechow/gists{/gist_id}","starred_url":"https://api.github.com/users/orzechow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzechow/subscriptions","organizations_url":"https://api.github.com/users/orzechow/orgs","repos_url":"https://api.github.com/users/orzechow/repos","events_url":"https://api.github.com/users/orzechow/events{/privacy}","received_events_url":"https://api.github.com/users/orzechow/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T15:53:13Z","updated_at":"2015-07-21T15:53:13Z","body":"Thanks for checking - it turned out, that I included an outdated cereal version.\r\nStupid mistake...\r\n\r\nWith the current master (and 1.1.2) it works :)"}}