【发布时间】:2015-05-21 20:07:47
【问题描述】:
所以我将在 Xcode 中尝试一个简单的 Eureqa API 示例,如下所示: https://code.google.com/p/eureqa-api/
但是,当我尝试编译它时,此行中 boost 标头的 access.hpp 中似乎存在错误: ...
{
// note: if you get a compile time error here with a
// message something like:
// cannot convert parameter 1 from <file type 1> to <file type 2 &>
// a likely possible cause is that the class T contains a
// serialize function - but that serialize function isn't
// a template and corresponds to a file type different than
// the class Archive. To resolve this, don't include an
// archive type other than that for which the serialization
// function is defined!!!
t.serialize(ar, file_version);
}
... 带有消息:'std::_1::pair'中没有名为'serialize'的成员
我应该怎么做才能解决这个问题?
【问题讨论】:
-
谢谢!我试过了,然后在utility.hpp中弹出这个错误:
ar & boost::serialization::make_nvp("first", const_cast<typef &>(p.first)); ar & boost::serialization::make_nvp("second", p.second);说:命名空间'boost::serialization'中没有名为'make_nvp'的成员 -
啊哈。我看到你确实回应了。正如您发现的那样,您需要对您回复的答案发表评论。或者/另外,您可以使用
@JusufAurumMerukh样式显式寻址(仅当它增加价值时)
标签: c++ serialization boost