Skip to content

Instantly share code, notes, and snippets.

@sailfish009
Created February 27, 2019 06:16
Show Gist options
  • Select an option

  • Save sailfish009/f02b6a50b54b80be211434d749153cad to your computer and use it in GitHub Desktop.

Select an option

Save sailfish009/f02b6a50b54b80be211434d749153cad to your computer and use it in GitHub Desktop.
template<typename T>
byte * toByteArray(T& t)
{
return (byte*)&t;
};
template<typename T>
void fromByteArray(T& t, byte *bytes)
{
t = *(T*)bytes;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment