template class without a name in c++
<p>I have two parallel classes, one which parses .xlsx files, and one which parses xls files.
I wrote the xlsx parser myself, but inherited from another xls parser to fit it into my class model. So far, so good.</p>

<p>Both classes end up using the same piece of code using rapidjson to create a json array for insertion to the db. However, on the xlsx side, everything works, but on the xls side, the inclusion and use of the rapidjson library give rise to the following error: </p>

<pre><code>excelparser/lib/rapidjson/rapidjson.h:370:1: error: template class without a name
</code></pre>

<p>Even if I remove all the code from xls.cpp and only leave a simple #include in xls.h I have the same error.</p>

<p>The lines in the header file are :</p>

<pre><code>//! UTF-16 encoding.
/*! http://en.wikipedia.org/wiki/UTF-16
    \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead.
    \implements Encoding
*/
template&lt;typename CharType = wchar_t&gt;
struct UTF16 {                                    // &lt;-- Line 370
    typedef CharType Ch;

    static Ch* Encode(Ch* buffer, unsigned codepoint) {
        if (codepoint &lt;= 0xFFFF) {
            RAPIDJSON_ASSERT(codepoint &lt; 0xD800 || codepoint &gt; 0xDFFF); // Code point itself cannot be surrogate pair 
            *buffer++ = static_cast&lt;Ch&gt;(codepoint);
        }
        else {
            RAPIDJSON_ASSERT(codepoint &lt;= 0x10FFFF);
            unsigned v = codepoint - 0x10000;
            *buffer++ = static_cast&lt;Ch&gt;((v &gt;&gt; 10) + 0xD800);
            *buffer++ = (v &amp; 0x3FF) + 0xDC00;
        }
        return buffer;
    }
};
</code></pre>
