-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Warning using "allocate" directly #579
Comments
This is obviously really low priority, especially since there's an opt-out, I just wanted there to be "visibility" for when others eventually get this warning. |
If using these allocators through allocator_traits (see fmtlib#579), compilation will fail since the hint type must be of type const void*, not value_type*.
I think it's OK since |
I can. Do you (or anyone that may see this) know when libc++ and libstdc++ introduced allocator_traits, or should I just key off of __cplusplus for them? |
MSVC's library implementers are aggressively following the deprecations from the standard library in C++17. Using their "daily" releases, this warning occurs:
The fix is easy,
T *new_ptr = std::allocator_traits<Allocator>::allocate(*this, new_capacity, FMT_NULL);
but that breaks C++98 compat, and I don't know if a small preprocessor mess is worth it for this one case. And I also don't know if Microsoft is going to fully commit to the deprecations in official releases "soon".For now, locally I just replace the this->allocate with the allocator_traits indirection, but that needs another change to actually work, so I'll submit a PR for that shortly.
The text was updated successfully, but these errors were encountered: