Store objects in the container instead of the pointers
Use `auto` and `decltype()` to deduce the actual type
Remove google sparsehash
Add the missing #define guard
Follow some coding style guidelines