-
Notifications
You must be signed in to change notification settings - Fork 72
[Aws::Crt::Optional] avoid std::aligned_storage #462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Context: Please note that |
We can't simply alias the two types like this. We used to do that, but later realized it didn't work, and removed the aliasing here: 402d222
|
Can we get rid of the deprecation warnings by using alignas instead of aligned_storage, as suggested on this stackoverflow post? Or we might be able to just remove the alignment stuff. I don't believe this library is putting anything in its custom Optional class that actually has alignment requirements |
@graebm I see, though why is |
@graebm Something like that (just pushed)? |
|
If the library is used by multiple applications on the system (like if aws-crt-cpp ends up in a package manager, and is distributed precompiled), we want to be sure it's compatible with our minimum spec C++11. |
@graebm you're right about |
std::aligned_storage is deprecated in c++23. Co-authored-by: Michael Graeb <[email protected]>
@graebm please let me know what you think, I believe there are two options:
|
@graebm ... for the first option, something like |
We don't guarantee it right now. But we aspire to someday |
Description of changes:
Checks if
std::optional
is available, and if so, aliasAws::Crt::Optional<T>
tostd::optional<T>
.Also, fix a missing
#include <type_traits>
when not aliasing, forstd::aligned_storage
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.