-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpp17/polymorphic_allocator.h is not standard complient #665
Comments
any news here? thanks. |
very unlucky, to get no reply here. Any one can at least give me a work around? |
Yes, it appears that most people around have gone dormant. I just did a quick google on this issue. It appears there is no portable standard C++ way of specifying the alignment of a type. Can you provide details of why this is a problem and how it manifests? |
The compiler refuses to compile ;-) |
I'm now using this: @@ -141,16 +141,16 @@ struct aligned_chunk<8> {
long long x;
};
template <>
-struct aligned_chunk<16> {
- __attribute__((aligned(16))) char x;
+struct alignas(16) aligned_chunk<16> {
+ char x;
};
template <>
-struct aligned_chunk<32> {
- __attribute__((aligned(32))) char x;
+struct alignas(32) aligned_chunk<32> {
+ char x;
};
template <>
-struct aligned_chunk<64> {
- __attribute__((aligned(64))) char x;
+struct alignas(64) aligned_chunk<64> {
+ char x;
};
// Adaptor to make a polymorphic allocator resource type from an STL allocator It is described here: https://en.cppreference.com/w/cpp/language/alignas |
Can you post a PR for this? |
That looks good. Please post a PR. |
This file containes
__attribute__((aligned())
statements, which are not standard complient.Please fix.
The text was updated successfully, but these errors were encountered: