Why does the C++ standard allow std::max_align_t and __STDCPP_DEFAULT_NEW_ALIGNMENT__ to be inconsistent?
问题 In Visual Studio, when compiling 64-bit: sizeof(std::max_align_t) is 8 __STDCPP_DEFAULT_NEW_ALIGNMENT__ is 16 So although std::max_align_t indicates that implementations of new should return pointers aligned to a multiple of 8 bytes, allocations with an alignment requirement of 16 bytes don't call the void* operator new (std::size_t count, std::align_val_t); method but call void* operator new (std::size_t count); (see https://en.cppreference.com/w/cpp/memory/new/operator_new) and expect them