#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <sstream>
#include <iomanip>
#include <initializer_list>
template <class KEY, class VALUE>
class Dict{
public:
std::map<KEY, VALUE> dictionary;
void update(KEY k, VALUE v){
dictionary[k] = v;
}
};
int main(){
Dict<std::string, std::string> d;
Dict<std::string, Dict> m;
//m['map'].display();
m.update("map", d);
}
and the error i get is:
1 2 3 4 5 6 7 8 9 10 11 12
test2.cpp: In function 'int main()':
test2.cpp:23:27: error: type/value mismatch at argument 2 in template parameter list for'template<class KEY, class VALUE> class Dict'
Dict<std::string, Dict> m;
^
test2.cpp:23:27: error: expected a type, got 'Dict'
test2.cpp:23:30: error: invalid type in declaration before ';' token
Dict<std::string, Dict> m;
^
test2.cpp:26:7: error: request for member 'dictionary' in 'm', which is of non-class type 'int'
m.dictionary["map"] = d;
^
I dont understand why it says it expects a type and got Dict?