For serialization of shared_ptr<const T>, if you open RCF\include\SF\SerializeSmartPtr.hpp, and change this line:
Code: Select all
if (pt && ctx.getEnabled() && ctx.query( pt, typeid(SmartPtrT), pv ))
, to
Code: Select all
if (pt && ctx.getEnabled() && ctx.query( (void *) pt, typeid(SmartPtrT), pv ))
, and this line:
Code: Select all
ctx.add( pt, typeid(SmartPtrT), *ppt );
to
Code: Select all
ctx.add( (void *) pt, typeid(SmartPtrT), *ppt );
, it should work. These changes will be in the next release.
To serialize C++11 enum classes - for now, you'll need to write a simple serialization function for each enum:
Code: Select all
template<typename T, typename U>
inline void serializeAs(SF::Archive & ar, T &t)
{
if (ar.isWrite())
{
U u = static_cast<U>(t);
ar & u;
}
else
{
U u;
ar & u;
t = static_cast<T>(u);
}
}
enum class DayOfWeek : short { Mon, Tue, Wed, Thu, Fri, Sat, Sun };
void serialize(SF::Archive & ar, DayOfWeek & d)
{
serializeAs<DayOfWeek, short>(ar, d);
}