Modernize to C++17: replace deprecated aligned_storage, add nodiscard#170
Modernize to C++17: replace deprecated aligned_storage, add nodiscard#170HFTrader wants to merge 1 commit into
Conversation
Bump minimum standard from C++11 to C++17 and apply modernizations: - Replace deprecated std::aligned_storage (removed in C++26) with alignas + std::byte arrays in bucket_container. Use std::launder for pointer access to constructed objects, and a separate storage_ptr() for construct/destroy on uninitialized storage. - Add [[nodiscard]] to public query functions: hash_function(), key_eq(), get_allocator(), hashpower(), bucket_count(), empty(), size(), capacity(), load_factor(), contains(). - Mark primary constructor explicit to prevent implicit conversion from size_type. - Update CMake target_compile_features from cxx_constexpr to cxx_std_17.
|
This is super useful since my compiler screams on every |
|
@HFTrader Instead of forcing I don't think they'll merge this, since forcing |
|
@carlocorradini thanks for the feedback — and good point that a hard bump is the heavier ask of the two. A couple of things worth weighing, though:
That said: the repo's last release was 2019 and there's a backlog of unmerged PRs, so I'm not optimistic either way. If a maintainer chimes in preferring the gated approach, I'm glad to rework it that way — just didn't want to add |
Summary
Bump minimum standard from C++11 to C++17 and apply modernizations:
std::aligned_storage(deprecated C++23, removed C++26) withalignas+std::bytearrays inbucket_container. Usestd::launderfor pointer access to constructed objects, and a separatestorage_ptr()for construct/destroy on uninitialized storage[[nodiscard]]to public query functions:hash_function(),key_eq(),get_allocator(),hashpower(),bucket_count(),empty(),size(),capacity(),load_factor(),contains()explicitto prevent implicit conversion fromsize_typetarget_compile_featuresfromcxx_constexprtocxx_std_17Test plan