
John Reid wrote:
I'm getting a runtime check error from MSVC8 in the following code checked out from cvs_head:
serialization/collections_load_imp.hpp line 116
...
template<class Archive, class Container, class InputFunction, class R> inline void load_collection(Archive & ar, Container &s) { s.clear(); // retrieve number of elements unsigned int count; unsigned int item_version; ar >> BOOST_SERIALIZATION_NVP(count); if(3 < ar.get_library_version()){ ar >> BOOST_SERIALIZATION_NVP(item_version); } R rx; rx(s, count); InputFunction ifunc; while(count-- > 0){ ifunc(ar, s, item_version); } }
I think this function would be more flexible if the clear call was removed. Users could decide if they want to call clear() or not. If you want append-like behaviour you wouldn't call clear(). If you know the container is already empty you also wouldn't have to call clear(). Regards, Brian Wood www.webEbenezer.net