简体   繁体   English

Boost.Serialization警告

[英]Boost.Serialization Warning

Not sure what is causing the following warning which, as I read, can be safely ignored 32 bit: 不知道是什么引起了以下警告,据我所读,可以安全地忽略32位:

conversion from 'std::streamsize' to 'size_t', possible loss of data

I am performing routine Boost serialization and the program is working great. 我正在执行例行的Boost序列化,并且程序运行良好。 The only problem is the compiler has a problem around the following code: 唯一的问题是编译器在以下代码方面存在问题:

while compiling class template member function 'void boost::archive::basic_binary_iprimitive<Archive,Elem,Tr>::load_binary(void *,size_t)'

Any idea what is up with this? 知道这是怎么回事吗?

std::streamsize is a signed integral type. std :: streamsize是带符号的整数类型。 size_t is the unsigned integer type. size_t是无符号整数类型。

That's an unsafe conversion because it may cause data loss. 这是不安全的转换,因为它可能会导致数据丢失。 The compiler detects an unsafe conversion and issues a warning. 编译器检测到不安全的转换并发出警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM