I'm not sure how I should replace this code:
// These two maps are reverses of each other for rapid lookup.
static std::map<std::string, DataTypeInfo> stringToDataTypeMap;
static std::map<DataModel::Column::DataType, DataTypeInfo> dataTypesMap;
static std::mutex mapMutex;
static void populateMaps() {
std::unique_lock<std::mutex> lock(mapMutex);
if (stringToDataTypeMap.size() == 0) {
... do the initialization
}
}
clazy is offering a warning of "non-POD static (map) [clazy-non-pod-global-static] on all three of the global static variables. I suspect this means I have a potential problem, and I imagine there's a different way I'm supposed to do this.
But I'm not sure what that is.
I'm I supposed to make these pointers, initialized to nullptr, instead?