Skip to content

Instantly share code, notes, and snippets.

@danlark1
Created April 13, 2020 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danlark1/fb6603b7144311f786d6d602c0eb3104 to your computer and use it in GitHub Desktop.
Save danlark1/fb6603b7144311f786d6d602c0eb3104 to your computer and use it in GitHub Desktop.
template <class T>
T Deserialize(const void* memory) {
T t;
memcpy(&t, memory, sizeof(T));
return t;
}
template <class T>
void Serialize(const T& t, void* memory) {
memcpy(memory, &t, sizeof(T));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment