error on check for existance in c++
Question: What does "argument of type ‘bool (BST<int>::Node::)(int)’ does not match ‘bool’
" mean?
___
Info:

I'm working on an assignment to make a binary search tree. My "contains" function doesn't compile though:

		bool contains(Item val)
		{
			if(val == myItem) return true;
			if(val < myItem)
				if (myLeft) return myLeft->contains;
				else return false;
			if(myRight) return myRight->contains;
			return false;
			
		}

I'm using `if(myLeft)` and `if(myRight)` to check for existence before I follow the nodes. But i get the following error message:

    BST.h:100:38: error: argument of type ‘bool (BST<int>::Node::)(int)’ does not match ‘bool’
    BST.h:102:32: error: argument of type ‘bool (BST<int>::Node::)(int)’ does not match ‘bool’

Where lines 100, and 102 are the ones containing if(myLeft) and if(myRight). The annoying part of this, is that my insert function works just fine:

		void insert(Item val)

		{
			if(val < myItem)

				if (myLeft)

					myLeft->insert(val);

				else

					myLeft = new Node(val);

			else if(val > myItem)

				if (myRight)

					myRight->insert(val);

				else

					myRight = new Node(val);
			else throw Exception("Insert()","Can't add duplicate values");

		}

and yet I do the exact same thing. I tried to change it to check against NULL, so it became `if(myLeft!=NULL)` and it gave the same error. any clues as to what I'm missing here?
error on check for existance in c++
===

Question: What does "argument of type ‘bool (BST<int>::Node::)(int)’ does not match ‘bool’
" mean?
___
Info:

I'm working on an assignment to make a binary search tree. My "contains" function doesn't compile though:

		bool contains(Item val)
		{
			if(val == myItem) return true;
			if(val < myItem)
				if (myLeft) return myLeft->contains;
				else return false;
			if(myRight) return myRight->contains;
			return false;
			
		}

I'm using `if(myLeft)` and `if(myRight)` to check for existence before I follow the nodes. But i get the following error message:

    BST.h:100:38: error: argument of type ‘bool (BST<int>::Node::)(int)’ does not match ‘bool’
    BST.h:102:32: error: argument of type ‘bool (BST<int>::Node::)(int)’ does not match ‘bool’

Where lines 100, and 102 are the ones containing if(myLeft) and if(myRight). The annoying part of this, is that my insert function works just fine:

		void insert(Item val)

		{
			if(val < myItem)

				if (myLeft)

					myLeft->insert(val);

				else

					myLeft = new Node(val);

			else if(val > myItem)

				if (myRight)

					myRight->insert(val);

				else

					myRight = new Node(val);
			else throw Exception("Insert()","Can't add duplicate values");

		}

and yet I do the exact same thing. I tried to change it to check against NULL, so it became `if(myLeft!=NULL)` and it gave the same error. any clues as to what I'm missing here?