mirror of
https://github.com/RPCS3/cereal.git
synced 2024-11-23 11:19:41 +00:00
Input archive: Add implicit serialization operator
This commit is contained in:
parent
60c69df968
commit
708a1bac4e
@ -700,6 +700,16 @@ namespace cereal
|
|||||||
return *self;
|
return *self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Implicit conversion for serialization constant types
|
||||||
|
// Such as "const int value = ar;"
|
||||||
|
template <typename T, typename = std::enable_if_t<std::is_default_constructible_v<T> && std::is_copy_constructible_v<T>>>
|
||||||
|
operator T()
|
||||||
|
{
|
||||||
|
T value{};
|
||||||
|
process( value );
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
//! Serializes any data marked for deferment using defer
|
//! Serializes any data marked for deferment using defer
|
||||||
/*! This will cause any data wrapped in DeferredData to be immediately serialized */
|
/*! This will cause any data wrapped in DeferredData to be immediately serialized */
|
||||||
void serializeDeferments()
|
void serializeDeferments()
|
||||||
|
Loading…
Reference in New Issue
Block a user