Created
February 24, 2020 22:10
-
-
Save sortofsleepy/00e851cc46a1cbb1be60c25f7e1087e6 to your computer and use it in GitHub Desktop.
useful c++ stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! 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