没有匹配的函数可用于调用 …与 dtl-cpp
我正在使用 dtl-cpp 逐行比较两个文件的差异。
我已经设置了这个比较器:
class LBCompareNSString : public dtl::Compare<NSString *> {
public:
virtual bool impl(const NSString *& A, const NSString *& B) const {
return [A isEqualToString:B];
}
};
我有两个 NSString
对象向量,就像自定义比较器一样:
std::vector<NSString *> linesInACxx;
std::vector<NSString *> linesInBCxx;
并且我以这种方式设置了 dtl-cpp:
LBCompareNSString comparator;
dtl::Diff< NSString *, std::vector<NSString *>, LBCompareNSString > dtlEngine(linesInACxx, linesInBCxx, comparator);
dtlEngine.compose();
但是,当我编译时,我收到此错误Diff.hpp:
Diff.hpp:506: error: no matching function for call to 'LBCompareNSString::impl(NSString*&, NSString*&)'
LBDifferenceEngine.mm:7: note: candidates are: virtual bool LBCompareNSString::impl(const NSString*&, const NSString*&) const
我不知道如何声明该方法,以便它能够工作。我尝试删除 virtual
和 const
但这不起作用。有谁知道我可能做错了什么?
I am using dtl-cpp to compare the difference of two files line by line.
I have set up this comparator:
class LBCompareNSString : public dtl::Compare<NSString *> {
public:
virtual bool impl(const NSString *& A, const NSString *& B) const {
return [A isEqualToString:B];
}
};
I have two vectors of NSString
objects, like so with the custom comparator:
std::vector<NSString *> linesInACxx;
std::vector<NSString *> linesInBCxx;
And I set up dtl-cpp in this way:
LBCompareNSString comparator;
dtl::Diff< NSString *, std::vector<NSString *>, LBCompareNSString > dtlEngine(linesInACxx, linesInBCxx, comparator);
dtlEngine.compose();
However, when I compile I get this error in Diff.hpp:
Diff.hpp:506: error: no matching function for call to 'LBCompareNSString::impl(NSString*&, NSString*&)'
LBDifferenceEngine.mm:7: note: candidates are: virtual bool LBCompareNSString::impl(const NSString*&, const NSString*&) const
I have no idea how to declare the method so it will work. I tried removing virtual
and const
but that did not work. Does anyone know what I might have done wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊哈!我发现我做错了什么。
应该
就像编译器所说的那样。
Aha! I found what I've done wrong.
should be
just like the compiler says.