Skip to content

Instantly share code, notes, and snippets.

@sortofsleepy
Created February 24, 2020 22:10
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 sortofsleepy/00e851cc46a1cbb1be60c25f7e1087e6 to your computer and use it in GitHub Desktop.
Save sortofsleepy/00e851cc46a1cbb1be60c25f7e1087e6 to your computer and use it in GitHub Desktop.
useful c++ stuff
//! borrowed from https://github.com/wdlindmeier/Cinder-Metal/blob/master/include/MetalHelpers.hpp
template <typename T, typename U >
const U static inline convert( const T & t )
{
U tmp;
memcpy(&tmp, &t, sizeof(U));
U ret = tmp;
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment