Invalid use of non-static data member
<p>It's a Heap implemented by myself(for algorithm contest).There are some compilation errors that I can't recover from...</p>

<pre><code>\Map_Heap.cpp|13|error: invalid use of non-static data member 'MapHeap&lt;DT&gt;::nv'|
\Map_Heap.cpp|19|error: from this location|
</code></pre>

<p>Code:</p>

<pre><code>#include&lt;cstdio&gt;
#include&lt;cstring&gt;
const int HEAP_SIZE=10005;
template&lt;class DT&gt;
struct MapHeap
{
    DT f[HEAP_SIZE+5];
    int mp1[HEAP_SIZE+5];//val -&gt; index
    int mp2[HEAP_SIZE+5];//index -&gt; val
    int nv;///line 13
    MapHeap():nv(0)
    {
        memset(mp1,-1,sizeof(mp1));
        memset(mp2,-1,sizeof(mp2));
    }
    void print(int n=nv)///line 19
    {
        for(int i=1;i&lt;=n;i++) printf("%d ",f[i]);
        puts("");
        for(int i=1;i&lt;=n;i++) printf("%d ",mp1[i]);
        puts("");
        for(int i=1;i&lt;=n;i++) printf("%d ",mp2[i]);
        puts("");
    }
};
</code></pre>
