Tutorial by Examples

c++11 The alignment requirement of a type can be queried using the alignof keyword as a unary operator. The result is a constant expression of type std::size_t, i.e., it can be evaluated at compile time. #include <iostream> int main() { std::cout << "The alignment requiremen...
C++11 The alignas keyword can be used to force a variable, class data member, declaration or definition of a class, or declaration or definition of an enum, to have a particular alignment, if supported. It comes in two forms: alignas(x), where x is a constant expression, gives the entity the ali...

Page 1 of 1