【发布时间】:2020-05-24 01:08:33
【问题描述】:
我正在定义一个结构如下:
struct memory_dump {
filesystem::path path;
boost::iostreams::mapped_file_source mapped_file;
memory_dump_type type;
long long int offset;
};
但是,gcc 会生成以下警告:
warning: implicitly-declared ‘boost::iostreams::mapped_file_source& boost::iostreams::mapped_file_source::operator=(const boost::iostreams::mapped_file_source&)’ is deprecated [-Wdeprecated-copy]
39 | struct memory_dump {
| ^~~~~~~~~~~
只有在将我的Boost 版本从1.62.0 左右升级到1.72.0 后才会出现此警告。我重新搜索了警告,但没有找到有关此特定 Boost 类、生成警告的原因以及如何修复它的任何信息。我的目标是存储mapped_file_source 的实例,以便我可以有效地访问内存映射文件的内容。
【问题讨论】:
-
你知道 deprecated 是什么意思吗?
-
@sweenish:是的。这意味着它不应该再使用了。但是应该改用什么呢?
标签: c++ gcc boost memory-mapped-files