Remove use of std::aligned_storage in any.hpp#1061
Remove use of std::aligned_storage in any.hpp#1061facontidavide merged 1 commit intoBehaviorTree:masterfrom
std::aligned_storage in any.hpp#1061Conversation
The type has been deprecated in C++23, which may cause warnings in client code using this header.
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This change removes the use of the
std::aligned_storagetype incontrib/any.hppand replaces it with a struct with an explicit alignment requirement inheriting an array of bytes of the right size.Motivation
The
std::aligned_storagetype has been deprecated in C++23, which may cause warnings in client code using theany.hppheader directly or indirectly.References for this change are this stackoverflow discussion and the paper P1413R3 that suggested the deprecation.
In that paper, the suggested change is the following:
However in the context of the library and its clang-tidy rules (in this case,
modernize-*rules) generate a warning with C-arrays and advise using astd::arrayinstead.Impacts on API / ABI
There is no impact on API, and as far as I know it should be ABI compatible.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.