c++ Template with 2 Formal Parameters Error.
<p>In my programming class we're just being introduced to the concept of templates within C++. This is a concept we never covered in my class on Java last semester, and the whole syntax of C++ is really throwing me for a loop. I'm getting a long string of compilation errors with the code I will post below. It would make me think that I'm missing something very obvious within the template Syntax. The following is just an example template I'm trying to work with, something to get me started on the homework. If any of you have any insights as to why this isn't compiling, I'd be grateful. Thanks!!</p>

<p>keyValuePair.h</p>

<pre><code>#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;

#ifndef KEYVALUEPAIR
#define KEYVALUEPAIR

template&lt;class key, class value&gt;
class keyValuePair
{
private:

key kvar;

value vvar; 

public:

keyValuePair(); //Default Constructor

void setKvar(key object1); //Method to set kvar to a value

void setVvar(value object2); //Method to set vvar to a value    

key getKvar(); //Method to return kvar

value getVvar(); //Method to return vvar

};

#include "keyValuePair.cpp"
#endif
</code></pre>

<p>keyValuePair.cpp</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;

#include "keyValuePair.h"


template&lt;class key, class value&gt;;
keyValuePair&lt;key, value&gt;::keyValuePair()
{
}

template&lt;class key, class value&gt;; //return the value of kvar
key keyValuePair&lt;key, value&gt;::getKvar()
{
return kvar;
}

template&lt;class key, class value&gt;; //return the value of vvar
value keyValuePair&lt;key, value&gt;::getVvar()
{
return vvar;
}

template&lt;class key, class value&gt;; //set the value of kvar
void keyValuePair&lt;key, value&gt;::setKvar(key&amp; object1)
{
object1 = kvar;
}

template&lt;class key, class value&gt;; //set the value of vvar
void keyValuePair&lt;key, value&gt;::setVvar(value&amp; object2)
{
object2 = vvar;
}
</code></pre>

<p>main.cpp</p>

<pre><code>#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;

#include "keyValuePair.h"

using namespace std; 

int main(int argc, char* argv[])
{

fstream myFile(argv[1], ios::in);
fstream fout("out.txt", ios::out); 

myFile.close();
fout.close(); 



keyValuePair&lt;string, int&gt; sample;

sample.setKvar("Hello World.");
sample.setVvar(3);

cout &lt;&lt; sample.getKvar() &lt;&lt; sample.getVvar() &lt;&lt; "\n"; 

return 0; 
}
</code></pre>
