mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-23 21:51:02 +00:00
Serialization fixes
This commit is contained in:
@@ -157,6 +157,12 @@ namespace utils
|
||||
return object;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void read_atomic(std::atomic<T>& val)
|
||||
{
|
||||
val = this->read<T>();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void read_optional(std::optional<T>& val)
|
||||
{
|
||||
@@ -390,6 +396,12 @@ namespace utils
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void write_atomic(const std::atomic<T>& val)
|
||||
{
|
||||
this->write(val.load());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void write_optional(const std::optional<T>& val)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user