我正在阅读关于directxmath的文档,并偶然发现了下一篇文章:
As an alternative to enforcing alignment in your C++ class directly by
overloading new/delete,you can use the pImpl idiom. If you ensure
your Impl class is aligned via __aligned_malloc internally,you can
then freely use aligned types within the internal implementation. This
is a good option when the ‘public’ class is a Windows Runtime ref
class or intended for use with std::shared_ptr<>,which can otherwise
disrupt careful alignment.