Commit 010f385d by huchi

fix some bugs under gcc 4.8.5

parent d954656b
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
using namespace nts; using namespace nts;
bool Compare(Example& a, Example& b) { bool Compare(const Example& a, const Example& b) {
return a.values.size() > b.values.size(); return a.values.size() > b.values.size();
} }
bool CompareRes(Result& a, Result& b) { bool CompareRes(const Result& a, const Result& b) {
return a.id < b.id; return a.id < b.id;
} }
......
...@@ -46,6 +46,10 @@ struct Result { ...@@ -46,6 +46,10 @@ struct Result {
using BufferType = vector<Example>; using BufferType = vector<Example>;
using ResBufferType = vector<Result>; using ResBufferType = vector<Result>;
bool Compare(const Example& a, const Example& b);
bool CompareRes(const Result& a, const Result& b);
namespace nts { // namespace nts(NiuTrans.Tensor) namespace nts { // namespace nts(NiuTrans.Tensor)
/* A `DataSet` is associated with a file which contains variable length data.*/ /* A `DataSet` is associated with a file which contains variable length data.*/
......
...@@ -90,17 +90,6 @@ inline vector<uint8_t> Split(const string& s, const string& delimiter) ...@@ -90,17 +90,6 @@ inline vector<uint8_t> Split(const string& s, const string& delimiter)
return fields; return fields;
} }
template <>
inline vector<bool> Split(const string& s, const string& delimiter)
{
vector<bool> fields;
for (const auto& p : SplitToPos(s, delimiter)) {
fields.emplace_back(
static_cast<bool>(strtol(s.data() + p.first, nullptr, 10)));
}
return fields;
}
} // namespace nts } // namespace nts
#endif // __STRING_UTIL_H__ #endif // __STRING_UTIL_H__
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论