I'm preparing for an exam on C++, as part of my preparation I want to implement a generic map without using anything from the STD for educational purposes.
Before jumping into implementation of everything, I want to know that the skeleton for my Map is solid and I use templates and template inheritance correctly.
Above is the skeleton of my Map. I would like to get an opinion about that skeleton.
#ifndef MAP_H_
#define MAP_H_
template <class K, class V>
class Map {
public:
/*
Map c'tors and d'tors.
*/
Map(); //C'tor
Map(const Map& map); //Copy c'tor
~Map(); //D'tor
/*
Map methods
*/
void insert(const K& key, const V& value);
bool isIn(const K& key) const;
void remove(const K& key);
void clear();
bool isEmpty();
int size() const;
template <class F>
Map filter(F& filterFunction);
/*
Map methods using Iterators
*/
class Iterator;
class ConstIterator;
Map::ConstIterator begin() const;
Map::ConstIterator end() const;
Map::Iiterator begin();
Map::Iterator end();
/*
Map operators
*/
const DataType& operator[](const KeyType key) const;
DataType& operator[](const KeyType key);
};
/*
Map::Pair class
*/
template <class K, class V>
class Map<K,V>::Pair {
};
/*
Map::Iterator class
*/
template <class K, class V>
class Map<K,V>::Iterator {
//to do
};
/*
Map::ConstIterator class
*/
template <class K, class V>
class Map<K,V>::ConstIterator : public Map<K,V>::Iterator {
//to do
};
/*
Map c'tors, methods and operators implementation
*/
//to do
#endif /* MAP_H_ */