Added string loading

This commit is contained in:
Shane Grant
2013-06-12 17:57:35 -07:00
parent 5d24d9f066
commit a4498932e4
2 changed files with 9 additions and 1 deletions

View File

@@ -96,6 +96,10 @@ namespace cereal
template<class CharT, class Traits, class Alloc>
void load(BinaryInputArchive & ar, std::basic_string<CharT, Traits, Alloc> & str)
{
size_t size;
ar & size;
str.resize(size);
ar.load_binary(const_cast<CharT*>(str.data()), size * sizeof(CharT));
std::cout << "Loading string: " << str << std::endl;
}
}