boostorg / heap

Boost.Heap
https://boost.org/libs/heap
18 stars 39 forks source link

Most members of std::allocate are deprecated in C++17 #9

Closed DanielaE closed 6 years ago

DanielaE commented 6 years ago

Replace them by their cousins from std::allocator_traits.

Signed-off-by: Daniela Engert dani@ngrt.de

timblechmann commented 6 years ago

thanks for the patch! the patch is quite intrusive so i wonder, if it would be reasonable to introduce a compatibility layer, similar to https://github.com/boostorg/lockfree/pull/39/files#diff-5cc965699b3eafbfdc551e045e0d20b5

DanielaE commented 6 years ago

Well, I've seen the mentioned compatibility layer, and honestly, I don't like it: it goes only a fraction of the path to the end (see my additional patch on top of that). You need full conformance to modern allocators to open the road to the future (e.g. C++17's polymorphic allocators). Another compatibility layer looks pretty much like std::allocator_traits - implemented in terms of std::allocator_traits.

timblechmann commented 6 years ago

yeah, i'm not totally sure what's the best way to handle deprecations, especially as long as we're still supporting c++98. lots of code could be done much more elegant without backwards compatibility :/