} here is the sample..
}
} #define key_t std::string
}
} // loc_t is a structure with 3 unsigned integer fields
} sparse_hash_map<key_t, loc_t> myMap;
} // for writing to file pointed by pointer fp
} myMap.write_metadata(fp);
} myMap.write_nopointer_data(fp);
} // for reading from file pointed by fp
} sparse_hash_map<key_t, loc_t> rMap;
} rMap.read_metadata(fp);
} rMap.read_nopointer_data(fp);
} // after reading and lookup is done
} rMap.clear();
Ah, I see. That won't work at all because string has pointers in it.
read/write_nopointer is intended for Plain Old Data types. You will
need to do something more complicated. Look at the documentation; it
has an example of how to use read/write IO with non-trivial key/value
types -- I forget the exact example, but it may even be for a string.
craig