I'm trying to manually port some Java into C++.
The Java:
public Class Item {
public String storage = "";
public Item(String s, int tag) { storage = s; }
...
}
public class ProcessItems {
Hashtable groups = new Hashtable();
void save(Item w) { groups.put(w.storage, w); }
}
My C++:
#include<iostream>
#include<unordered_map>
#include<string>
class Item {
public:
std::string storage;
Item(std::string s, int tag) { storage = s; }
...
}
class ProcessItems {
public:
std::unordered_map<std::string, std::string> *groups = new std::unordered_map<std::string, std::string>();
void save(Item w) { groups.insert(w::storage, w); }
...
}
Compiling in C++ 11 I get the following error:
error: invalid use of ‘::’
string, std::string> *words = new std::unordered_map<std::string, std::string>();
^
Where'd I go wrong?