{"action":"created","issue":{"url":"https://api.github.com/repos/USCiLab/cereal/issues/216","repository_url":"https://api.github.com/repos/USCiLab/cereal","labels_url":"https://api.github.com/repos/USCiLab/cereal/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/USCiLab/cereal/issues/216/comments","events_url":"https://api.github.com/repos/USCiLab/cereal/issues/216/events","html_url":"https://github.com/USCiLab/cereal/issues/216","id":98651809,"number":216,"title":"Issue with load_and_construct and versioning.","user":{"login":"M2tM","id":923621,"avatar_url":"https://avatars.githubusercontent.com/u/923621?v=3","gravatar_id":"","url":"https://api.github.com/users/M2tM","html_url":"https://github.com/M2tM","followers_url":"https://api.github.com/users/M2tM/followers","following_url":"https://api.github.com/users/M2tM/following{/other_user}","gists_url":"https://api.github.com/users/M2tM/gists{/gist_id}","starred_url":"https://api.github.com/users/M2tM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M2tM/subscriptions","organizations_url":"https://api.github.com/users/M2tM/orgs","repos_url":"https://api.github.com/users/M2tM/repos","events_url":"https://api.github.com/users/M2tM/events{/privacy}","received_events_url":"https://api.github.com/users/M2tM/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/USCiLab/cereal/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/USCiLab/cereal/milestones/5","html_url":"https://github.com/USCiLab/cereal/milestones/v1.2.0","labels_url":"https://api.github.com/repos/USCiLab/cereal/milestones/5/labels","id":634032,"number":5,"title":"v1.2.0","description":"","creator":{"login":"AzothAmmo","id":1634639,"avatar_url":"https://avatars.githubusercontent.com/u/1634639?v=3","gravatar_id":"","url":"https://api.github.com/users/AzothAmmo","html_url":"https://github.com/AzothAmmo","followers_url":"https://api.github.com/users/AzothAmmo/followers","following_url":"https://api.github.com/users/AzothAmmo/following{/other_user}","gists_url":"https://api.github.com/users/AzothAmmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AzothAmmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzothAmmo/subscriptions","organizations_url":"https://api.github.com/users/AzothAmmo/orgs","repos_url":"https://api.github.com/users/AzothAmmo/repos","events_url":"https://api.github.com/users/AzothAmmo/events{/privacy}","received_events_url":"https://api.github.com/users/AzothAmmo/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":28,"state":"open","created_at":"2014-04-18T17:13:10Z","updated_at":"2016-03-30T18:45:19Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2015-08-03T01:10:30Z","updated_at":"2016-03-30T18:45:19Z","closed_at":"2016-03-30T18:45:19Z","body":"I wanted to switch my code to the versioned save/load/serialize methods, but was having trouble with the namespace included in the following causing issues with the macro:\r\n\r\nCEREAL_CLASS_VERSION(MV::Scene::Node, 1);\r\n\r\nBecause my version of cereal was pretty old I decided to pull and get latest, and I am no longer having issues with the above line, I changed the signature of serialize and load_and_construct from this original state:\r\n\r\ntemplate <class Archive>\r\nvoid serialize(Archive & a_archive)\r\n\r\ntemplate <class Archive>\r\nstatic void load_and_construct(Archive & a_archive, cereal::construct<Node> &a_construct) \r\n\r\n\r\nTo this:\r\n\r\ntemplate <class Archive>\r\nvoid serialize(Archive & a_archive, const uint32_t a_version)\r\n\r\ntemplate <class Archive>\r\nstatic void load_and_construct(Archive & a_archive, cereal::construct<Node> &a_construct, const uint32_t a_version) \r\n\r\nAnd am now getting the following error which seems to indicate the load_and_construct is no longer actually being detected due to the versioned function signature:\r\n\r\n    1>C:\\git\\external\\cereal\\include\\cereal/access.hpp(300): error C2512: 'MV::Scene::Node::Node': no appropriate default constructor available (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/details/traits.hpp(1209): note: see reference to function template instantiation 'T *cereal::access::construct<TT>(void)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              T=MV::Scene::Node,\r\n    1>              TT=MV::Scene::Node\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/details/traits.hpp(1290): note: see reference to class template instantiation 'cereal::traits::is_default_constructible<T>' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              T=MV::Scene::Node\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/types/memory.hpp(307): note: see reference to class template instantiation 'cereal::detail::Construct<T,Archive,false,false>' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              T=MV::Scene::Node,\r\n    1>              Archive=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(854): note: see reference to function template instantiation 'void cereal::load<AA,MV::Scene::Node>(Archive &,cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &> &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              AA=cereal::JSONInputArchive,\r\n    1>              Archive=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>&>(T)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              T=cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &> &\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>&>(T)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              T=cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &> &\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/archives/json.hpp(858): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>&>(cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &> &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/archives/json.hpp(858): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>&>(cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &> &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(854): note: see reference to function template instantiation 'void cereal::load<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>(cereal::JSONInputArchive &,cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>> &)' being compiled (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<T,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<T,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<_Ty>(T &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              _Ty=cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>,\r\n    1>              T=cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<_Ty>(T &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              _Ty=cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>,\r\n    1>              T=cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/types/memory.hpp(189): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>>(cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>> &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/types/memory.hpp(189): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>>>(cereal::NameValuePair<cereal::memory_detail::PtrWrapper<std::shared_ptr<MV::Scene::Node> &>> &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(854): note: see reference to function template instantiation 'void cereal::load<AA,MV::Scene::Node>(Archive &,std::shared_ptr<MV::Scene::Node> &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              AA=cereal::JSONInputArchive,\r\n    1>              Archive=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<std::shared_ptr<MV::Scene::Node>,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=std::shared_ptr<MV::Scene::Node>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<std::shared_ptr<MV::Scene::Node>,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=std::shared_ptr<MV::Scene::Node>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<std::shared_ptr<MV::Scene::Node>&>(T)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              T=std::shared_ptr<MV::Scene::Node> &\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<std::shared_ptr<MV::Scene::Node>&>(T)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              T=std::shared_ptr<MV::Scene::Node> &\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/archives/json.hpp(858): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<std::shared_ptr<MV::Scene::Node>&>(std::shared_ptr<MV::Scene::Node> &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/archives/json.hpp(858): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<std::shared_ptr<MV::Scene::Node>&>(std::shared_ptr<MV::Scene::Node> &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(854): note: see reference to function template instantiation 'void cereal::load<std::shared_ptr<MV::Scene::Node>&>(cereal::JSONInputArchive &,cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &> &)' being compiled (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<T,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(777): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::processImpl<T,0>(T &)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive,\r\n    1>              T=cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<_Ty>(T &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              _Ty=cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>,\r\n    1>              T=cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  C:\\git\\external\\cereal\\include\\cereal/cereal.hpp(680): note: see reference to function template instantiation 'void cereal::InputArchive<cereal::JSONInputArchive,0>::process<_Ty>(T &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              _Ty=cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>,\r\n    1>              T=cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>\r\n    1>          ] (compiling source file Source\\DiggerGame\\diggerGame.cpp)\r\n    1>  Source\\DiggerGame\\diggerGame.cpp(50): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>>(cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &> &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ]\r\n    1>  Source\\DiggerGame\\diggerGame.cpp(50): note: see reference to function template instantiation 'ArchiveType &cereal::InputArchive<ArchiveType,0>::operator ()<cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &>>(cereal::NameValuePair<std::shared_ptr<MV::Scene::Node> &> &&)' being compiled\r\n    1>          with\r\n    1>          [\r\n    1>              ArchiveType=cereal::JSONInputArchive\r\n    1>          ]"},"comment":{"url":"https://api.github.com/repos/USCiLab/cereal/issues/comments/203573869","html_url":"https://github.com/USCiLab/cereal/issues/216#issuecomment-203573869","issue_url":"https://api.github.com/repos/USCiLab/cereal/issues/216","id":203573869,"user":{"login":"AzothAmmo","id":1634639,"avatar_url":"https://avatars.githubusercontent.com/u/1634639?v=3","gravatar_id":"","url":"https://api.github.com/users/AzothAmmo","html_url":"https://github.com/AzothAmmo","followers_url":"https://api.github.com/users/AzothAmmo/followers","following_url":"https://api.github.com/users/AzothAmmo/following{/other_user}","gists_url":"https://api.github.com/users/AzothAmmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AzothAmmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzothAmmo/subscriptions","organizations_url":"https://api.github.com/users/AzothAmmo/orgs","repos_url":"https://api.github.com/users/AzothAmmo/repos","events_url":"https://api.github.com/users/AzothAmmo/events{/privacy}","received_events_url":"https://api.github.com/users/AzothAmmo/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T18:45:19Z","updated_at":"2016-03-30T18:45:19Z","body":"done done"}}