template error message c++
<p>I have the following header file:</p>

<pre><code>#ifndef DATABASE_H
#define DATABASE_H


#include &lt;vector&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;

#include "record.h"

using namespace std;

template &lt;class value&gt;
class Database {

  public:

    void write (ostream&amp; out, DBScope scope) const;

    Database &lt;value&gt;() {};
    ~Database();

  private:

    vector &lt;Record&lt;value&gt; &gt; records;

};

#include "database.tem"

#endif
</code></pre>

<p>database.tem:</p>

<pre><code>template &lt;class value&gt;
void Database&lt;value&gt;::write (ostream&amp; out, DBScope scope) const {

 class vector &lt;Record &lt;value&gt; &gt;::iterator itr = records.begin();

 switch (scope) {

    case AllRecords:
      for (; itr != records.end(); itr++) out &lt;&lt; itr;
      break;
    case SelectedRecords:
      for (; itr != records.end(); itr++) {
        if (itr.isSelected) out &lt;&lt; itr;
      }
      break;

  }
}
</code></pre>

<p>I was running this header a long with another file and produced this error message, noting that in my header file I have another file called database.tem which is <code>#include "database.tem"</code> into my <code>database.h</code> file:</p>

<pre><code>    database.tem: In member function 'void Database&lt;value&gt;::write (std:: ostream&amp;, DBScope) const [with value = int]':
database.tem: In member function 'void Database&lt;value&gt;::write(std::ostream&amp;, DBScope) const [with value = int]':
interactive.cpp:285:   instantiated from 'bool WriteCommand(Database&lt;value&gt;&amp;) [with value = int]'
interactive.cpp:127:   instantiated from 'bool DispatchCommand(CommandT, Database&lt;value&gt;&amp;) [with value = int]'
interactive.cpp:74:   instantiated from 'void MainLoop(Database&lt;value&gt;&amp;) [with value = int]'
interactive.cpp:99:   instantiated from here
database.tem:6: error: conversion from '__gnu_cxx::__normal_iterator&lt;const Record&lt;int&gt;*, std::vector&lt;Record&lt;int&gt;, std::allocator&lt;Record&lt;int&gt; &gt; &gt; &gt;' to non-scalar type '__gnu_cxx::__normal_iterator&lt;Record&lt;int&gt;*, std::vector&lt;Record&lt;int&gt;, std::allocator&lt;Record&lt;int&gt; &gt; &gt; &gt;' requested
interactive.cpp:285:   instantiated from 'bool WriteCommand(Database&lt;value&gt;&amp;) [with value = int]'
interactive.cpp:127:   instantiated from 'bool DispatchCommand(CommandT, Database&lt;value&gt;&amp;) [with value = int]'
interactive.cpp:74:   instantiated from 'void MainLoop(Database&lt;value&gt;&amp;) [with value = int]'
interactive.cpp:99:   instantiated from here
database.tem:11: error: no match for 'operator&lt;&lt;' in 'out &lt;&lt; itr'
</code></pre>

<p>I have no idea what this messsage is talking about, can someone help me</p>
