Your first error for Node <string, int> testnode; is because you don't have a default constructor defined in your class. So either define one, or instantiate your class with the proper values.
the __Key & key() lines look like functions that return a reference to a __Key object. You probably need to say __Key key; to define your class variable.
1. Node <string, int> testnode;
That means create a Node using the default constructor (constructor which takes no parameters) and you do not have such a constructor.
If you have a constructor which takes parameters - like you have _ then if you want/need a default
constructor, then you the programmer must provide it - the compiler will not provide it.
2. You have some serious issues here.
Written like this, these are function declarations:
1 2
__Key & key();
__Value & value();
Which means that these statements in the constructor are incorrect:
1 2 3 4 5
Node(__Key & __k, __Value & __v)
{
key = __k; //error - key is not a variable
value = __v; //error - value is not a variable
}
Which leads us to another issue:
Where are you goung to store the values passed
in the constructor ( __k and __v) ?
Exactly!
I know I should add key and value under private so I can use the constructor properly.
These "errors" came with the code, I don't know if they were put there intentionally.
Thanks for the help.