내 구조체 :부스트 직렬화 경고 C4308 : 음의 정수 상수는 부호없는 형식으로 변환
struct member{
std::string ip_address;
std::string port;
protected:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & ip_address;
ar & port;
}
};
내가 저장하고 나는 그것을 할 예상대로 모든 데이터가 완벽하게 작동로드를 사용
std::vector<member> members;
std::ostringstream ss;
boost::archive::text_oarchive oa(ss);
oa<<members;
std::istringstream ss_(received_data.data());
boost::archive::text_iarchive ia(ss_);
ia>>members;
하지만 컴파일에 나는 당신이 것을
warning C4308: negative integral constant converted to unsigned type
1> c:\program files\boost\boost_1_51\boost\serialization\static_warning.hpp(92) : see reference to class template instantiation 'boost::mpl::print<T>' being compiled
1> with
1> [
1> T=boost::serialization::BOOST_SERIALIZATION_STATIC_WARNING_LINE<98>
1> ]
1> c:\program files\boost\boost_1_51\boost\archive\detail\check.hpp(98) : see reference to class template instantiation 'boost::serialization::static_warning_test<B,L>' being compiled
1> with
1> [
1> B=false,
1> L=98
1> ]
1> c:\program files\boost\boost_1_51\boost\archive\detail\oserializer.hpp(313) : see reference to function template instantiation 'void boost::archive::detail::check_object_tracking<T>(void)' being compiled
1> with
1> [
1> T=std::vector<member>
1> ]
1> c:\program files\boost\boost_1_51\boost\archive\detail\oserializer.hpp(525) : see reference to function template instantiation 'void boost::archive::detail::save_non_pointer_type<Archive>::invoke<T>(Archive &,T &)' being compiled
1> with
1> [
1> Archive=boost::archive::text_oarchive,
1> T=std::vector<member>
1> ]
1> c:\program files\boost\boost_1_51\boost\archive\detail\common_oarchive.hpp(69) : see reference to function template instantiation 'void boost::archive::save<Archive,T>(Archive &,T &)' being compiled
1> with
1> [
1> Archive=boost::archive::text_oarchive,
1> T=std::vector<member>
1> ]
1> c:\program files\boost\boost_1_51\boost\archive\basic_text_oarchive.hpp(80) : see reference to function template instantiation 'void boost::archive::detail::common_oarchive<Archive>::save_override<T>(T &,int)' being compiled
1> with
1> [
1> Archive=boost::archive::text_oarchive,
1> T=std::vector<member>
1> ]
1> c:\program files\boost\boost_1_51\boost\archive\detail\interface_oarchive.hpp(63) : see reference to function template instantiation 'void boost::archive::basic_text_oarchive<Archive>::save_override<T>(T &,int)' being compiled
1> with
1> [
1> Archive=boost::archive::text_oarchive,
1> T=std::vector<member>
1> ]
1> c:\users\user\desktop\shve\shve\member_server.h(58) : see reference to function template instantiation 'Archive &boost::archive::detail::interface_oarchive<Archive>::operator <<<std::vector<_Ty>>(T &)' being compiled
1> with
1> [
1> Archive=boost::archive::text_oarchive,
1> _Ty=member,
1> T=std::vector<member>
1> ]
그래서, 문제는 무엇인가? –
경고를받는 이유는 무엇입니까? 어떻게 해결합니까? –
다른 컴파일러를 사용하면 같은 원인으로 다른 경고가 생성 될 수 있습니다. include/boost/mpl/print.hpp : 50 : 23 : 경고 : 0으로 나누기가 정의되지 않음 [0으로 나누기]' – maxschlepzig