LDPL C++ Types

TEXT
//TEXT is just std::string
NUMBER
#define ldpl_number double
MAP
template<typename T>
struct ldpl_map {
unordered_map<string, T> inner_collection;
T& operator [] (const string& i) {
return inner_collection[i];
}
T& operator [] (ldpl_number i) {
return inner_collection[to_ldpl_string(i)];
}
};
LIST
template<typename T>
struct ldpl_list {
vector<T> inner_collection;
T& operator [] (ldpl_number i) {
i = floor(i);
if (i < 0 || i >= inner_collection.size()) {
cerr << \"Runtime Error: LIST index \" << i << \" out of range [0, \"
<< inner_collection.size() << \")\" << endl;
exit(1);
}
return inner_collection[i];
}
};