[Spatial] [spatial:tickets] #6 C++20 std::allocator::rebind is deprecated
Library of generic, k-d tree multi-dimensional containers
Brought to you by:
bouhdevel
From: Dario M. <dm...@us...> - 2021-03-06 15:07:34
|
--- ** [tickets:#6] C++20 std::allocator::rebind is deprecated** **Status:** open **Milestone:** 2.1.9 **Created:** Sat Mar 06, 2021 03:07 PM UTC by Dario Mariani **Last Updated:** Sat Mar 06, 2021 03:07 PM UTC **Owner:** nobody In std::allocator, the member rebind, construct and destroy were deprecated in C++20 and other allocators are doing the same (e.g. Intel OneTBB). A possible solution is: ~~~ - typedef typename Alloc::template rebind - <Kdtree_link<Key, Value> >::other Link_allocator; - typedef typename Alloc::template rebind - <value_type>::other Value_allocator; + using Link_allocator = std::allocator_traits<Alloc>::template rebind_alloc<Kdtree_link<Key, Value>>; + using Value_allocator = std::allocator_traits<Alloc>::template rebind_alloc<value_type>; ~~~ and ~~~ - get_value_allocator().construct(mutate_pointer(&safe.link->value), - value); + Value_allocator v_alloc = get_value_allocator(); + std::allocator_traits<Value_allocator>::construct(v_alloc, mutate_pointer(&safe.link->value), value); ~~~ --- Sent from sourceforge.net because spa...@li... is subscribed to https://sourceforge.net/p/spatial/tickets/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/spatial/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |