std::shared_ptr works with pointer tracking

This commit is contained in:
Laurent Itti
2013-06-13 15:54:08 -07:00
parent e11edef4c8
commit 58abf1d2b9
7 changed files with 184 additions and 24 deletions

View File

@@ -82,6 +82,12 @@ namespace cereal
//std::cout << "Loading NVP... " << std::endl;
ar & t.value;
}
template <class Archive, class T>
void serialize( Archive & ar, T * & t )
{
static_assert(!sizeof(T), "Cereal does not support serializing raw pointers - please use a smart pointer");
}
}
#endif // CEREAL_BINARY_ARCHIVE_BINARY_ARCHIVE_HPP_