diff --git a/gtsam/base/FastMap.h b/gtsam/base/FastMap.h index 965eeba38..b26dfe1c9 100644 --- a/gtsam/base/FastMap.h +++ b/gtsam/base/FastMap.h @@ -20,6 +20,7 @@ #include #include +#include namespace gtsam { @@ -30,6 +31,7 @@ namespace gtsam { * we've seen that the fast_pool_allocator can lead to speedups of several * percent. */ + template class FastMap : public std::map, boost::fast_pool_allocator > > { @@ -50,6 +52,16 @@ public: /** Copy constructor from the base map class */ FastMap(const Base& x) : Base(x) {} + private: + /** Serialization function */ + friend class boost::serialization::access; + template + void serialize(ARCHIVE & ar, const unsigned int version) { + //You are not supposed to do this: + boost::serialization::serialize(ar, *this, version); + //Instead you are supposed to do this: but it doesnt work + // ar & boost::serialization::base_object(*this); + } }; }