Created
February 3, 2015 17:04
-
-
Save PIlin/442a0f516e57458328d8 to your computer and use it in GitHub Desktop.
This file contains 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
template <int A> struct aligned; | |
template <> struct __declspec(align(1)) aligned < 1 > {}; | |
template <> struct __declspec(align(2)) aligned < 2 > {}; | |
template <> struct __declspec(align(4)) aligned < 4 > {}; | |
template <> struct __declspec(align(8)) aligned < 8 > {}; | |
template <> struct __declspec(align(16)) aligned < 16 > {}; | |
template <> struct __declspec(align(32)) aligned < 32 > {}; | |
template <int size, int align> | |
union aligned_type { | |
aligned<align> mAligned; | |
char mPad[size]; | |
}; | |
template <int size, int align> | |
struct aligned_storage { | |
using type = aligned_type < size, align > ; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment