How to instantiate Map within a class?
<p>I'm making an encoding class. its currently failing to build. I'm instantiating a map from within a function and am getting the error message "Delete called on 'Map::Comparator' that is abstract but has non-virtual destructor". Any ideas how to get this to build?</p>

<p>Here's the header file;</p>

<pre><code>#ifndef _encoding_
#define _encoding_

#include "bstream.h"
#include "vector.h"
#include "map.h"
#include "HuffmanTypes.h"
#include "pqueue.h"


class Encoding {

public:
    Encoding();
    ~Encoding();

    void compress(ibstream&amp; infile, obstream&amp; outfile);
    void decompress(ibstream&amp; infile, obstream&amp; outfile);
    //Map&lt;ext_char, std::string&gt; *referenceTable;
    std::string compresskey;
private:


    string filename;
    Map&lt;ext_char, int&gt; getFrequency(ibstream&amp; infile);
    void createHuffman();
    //Map&lt;ext_char, int&gt; *frequencyTable;

    HuffmanPQueue huffqueue;
    //void buildTree();
    //void createReferenceTable();
    //Node getNode(Node root);
    //void tracePaths(Node root, string path, int weight);


};

#endif
</code></pre>

<p>Here's the cpp file:</p>

<pre><code>/**
 * File: encoding.cpp
 * ------------------
 * Place your Encoding class implementation here.
 */

#include "encoding.h"

#include "string.h"
#include "map.h"
#include "strlib.h"
#include "HuffmanTypes.h"
#include "pqueue.h"

using namespace std;

Encoding::Encoding() {

}

Encoding::~Encoding() {

}

void Encoding::compress(ibstream&amp; infile, obstream&amp; outfile) {

    Map&lt;ext_char, int&gt; frequencyTable;

    frequencyTable = getFrequency(infile);

    compresskey = "";


    foreach(ext_char key in frequencyTable) {

        int freq = frequencyTable.get(key);

        Node* newnode = new Node;
        newnode-&gt;character = key;
        newnode-&gt;weight = freq;
        newnode-&gt;zero = NULL;
        newnode-&gt;one = NULL;

        huffqueue.enqueue(newnode);
        string keystring = integerToString(key);
        string valstring = integerToString(freq);
        compresskey = compresskey + "Key = " + keystring + " " + "Freq = " + valstring + " ";

    }
    //buildTree();
    //createReferenceTable();

}

void Encoding::decompress(ibstream&amp; infile, obstream&amp; outfile) {

}

Map&lt;ext_char, int&gt; Encoding::getFrequency(ibstream&amp; infile) {

    Map&lt;ext_char, int&gt; frequencyTable;

    int ch;

    while((ch = infile.get()) != EOF){
        if(frequencyTable.containsKey(ch)){
            int count;
            count = frequencyTable.get(ch);
            frequencyTable[ch] = ++count;
        }

        else {
            frequencyTable.put(ch, 1);
        }
    }
    frequencyTable.put(PSEUDO_EOF, 1);

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