Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10703: boost_1_56_0\boost/serialization/shared_ptr.hpp(161) : error C2059: syntax error : 'template' on msvc12
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-07 19:26:42
#10703: boost_1_56_0\boost/serialization/shared_ptr.hpp(161) : error C2059: syntax
error : 'template' on msvc12
-------------------------------+---------------------------
Reporter: kangjoni76@⦠| Owner: ramey
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: serialization
Version: Boost 1.56.0 | Severity: Problem
Resolution: invalid | Keywords:
-------------------------------+---------------------------
Comment (by anonymous):
Robert, the code below appears to reproduce the same issue described here.
Instead of entering a new issue, I'm adding to this one.
Further, if you remove the use of template, which is sometimes necessary
for Visual Studio, it gets an error:
D:\SSIII_Engine_x64\ThirdParty\Libraries\boost\boost/serialization/shared_ptr.hpp(261):
error C2039: 'get_helper' : is not a member of
'boost::archive::polymorphic_iarchive'
This second error appears to be related to issue 10727, but I haven't been
able to fix it using the headers from the main or development branches.
What was the specific file changed to fix 10727?
{{{
#include "stdafx.h"
#include <memory>
#include <fstream>
#include <boost/archive/polymorphic_iarchive.hpp>
#include <boost/archive/polymorphic_oarchive.hpp>
#include <boost/archive/polymorphic_text_iarchive.hpp>
#include <boost/serialization/shared_ptr.hpp>
class Test
{
int a;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & a;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
std::shared_ptr<Test> ptr = std::make_shared<Test>();
std::ifstream ifs("filename");
boost::archive::polymorphic_iarchive& archive =
boost::archive::polymorphic_text_iarchive(ifs);
archive >> ptr;
return 0;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10703#comment:4> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC