Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/156.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 没有用于调用的匹配函数_C++_Class_Pointers_Member - Fatal编程技术网

C++ 没有用于调用的匹配函数

C++ 没有用于调用的匹配函数,c++,class,pointers,member,C++,Class,Pointers,Member,我有一个.h文件,其中包含 template <typename DataType> class BST { private: struct BinaryNode { //variables } public: BinaryNode *root; int contains(const DataType &x, BinaryNode *&t) const; } 的实现包含 template <typen

我有一个
.h
文件,其中包含

template <typename DataType>
class BST
{
private:
    struct BinaryNode
    {
         //variables
    }
public:
    BinaryNode *root;

    int contains(const DataType &x, BinaryNode *&t) const;
}
的实现包含

template <typename DataType>int BST<DataType>::contains(const DataType &x, BST<DataType>::BinaryNode *&t) const
{
 //some stuff
}
模板int BST::contains(const数据类型&x,BST::BinaryNode*&t)const
{
//一些东西
}
我有一个问题,它说:
没有匹配的函数调用BST::contains(SequenceMap*const,BST::BinaryNode*&)
theMap.contains(this,theMap.root)


我不确定这其中的哪一部分是错误的,因为
this
Datatype
SequenceMap
的变量,而
theMap.root
BinaryNode
。我已尝试将其更改为
*map.root
,但没有帮助。

该函数通过引用而不是指针调用x。您可能想要:

theMap.contains(*this, theMap.root);

该函数通过引用而不是指针调用x。您可能想要:

theMap.contains(*this, theMap.root);

该函数通过引用而不是指针调用x。您可能想要:

theMap.contains(*this, theMap.root);

该函数通过引用而不是指针调用x。您可能想要:

theMap.contains(*this, theMap.root);

BST
您的
BST
模板声明在哪里??您是否确实缺少
模板
类BST{/…
@πάνταῥεῖ 实际上,jaba10只是添加了代码高亮显示和大写。我是在BST上面添加模板声明的人,如第2版所示。在公共方法接口中使用私有类型不是很好……好吧,那么你澄清得很好。
BST
你在哪里为
BST
添加模板声明?你是真的吗几乎缺少
模板
类BST{/…
@πάνταῥεῖ 实际上,jaba10只是添加了代码高亮显示和大写。我是在BST上面添加模板声明的人,如第2版所示。在公共方法接口中使用私有类型不是很好……好吧,那么你澄清得很好。
BST
你在哪里为
BST
添加模板声明?你是真的吗几乎缺少
模板
类BST{/…
@πάνταῥεῖ 实际上,jaba10只是添加了代码高亮显示和大写。我是在BST上面添加模板声明的人,如第2版所示。在公共方法接口中使用私有类型不是很好……好吧,那么你澄清得很好。
BST
你在哪里为
BST
添加模板声明?你是真的吗几乎缺少
模板
类BST{/…
@πάνταῥεῖ 实际上,jaba10只是添加了代码高亮显示和大写的内容。我是在BST上面添加模板声明的人,如修订版2所示。在公共方法接口中使用私有类型不是很好……好吧,那么你很好地澄清了这一点。