This must be a repeat question, but I have not found it after searching for 2 days … I’m using MSVC with /std:c17 /std:c++17 and trying to get alignas(64) to work with arrays of doubles. The syntax in the code below is the only one I have found that compiles, but it’s not aligning … ..
This is the code I usually write: alignas(16) __m128 myBuffer; But maybe (since the object-array is 128*8 bit = 128 byte) I should write: alignas(128) __m128 myBuffer; ? Or "since the first 16 byte are aligned" in the first example, the rest will be automatically aligned in memory? Source: Windows Que..
Can C++ template parameters be used to control specifiers on the class itself to minimize some code duplication? For example: I have a class that I’d like to use both in a concurrent context (and container) with the alignas specifier, and also in a single-threaded context without the alignas specifier. The size of the class ..