erikerlandson / st_tree

A fast and flexible c++ template class for tree data structures
https://github.com/erikerlandson/st_tree/wiki
Apache License 2.0
95 stars 20 forks source link

No stateful allocator? #26

Closed Raildex closed 4 years ago

Raildex commented 4 years ago

STL containers allow passing the allocator (not the type) as a constructor argument. I'd like to see it here aswell.

erikerlandson commented 4 years ago

Hi @Raildex, is it sufficient to support a constructor that takes an allocator:

tree(const node_allocator_type& a) : _root(NULL), _node_allocator(a) {}
erikerlandson commented 4 years ago

re-opening, I'll close when I push an upate with new allocator

erikerlandson commented 4 years ago

@Raildex I pushed a fix to head of develop branch that defines new constructor:

tree(const node_allocator_type& a) : _root(NULL), _node_allocator(a) {}

If that works for you, let me know and I'll close this issue

Raildex commented 4 years ago

it works perfectly fine now 👍

erikerlandson commented 4 years ago

thank you!