OK. But inheritance supposed to fulfii all conditions, isn't it? In fact, it is. At least code compiled and run. Or should i do smth like types redefinition?
Anyway, std::set does not allocate objects of type int. It allocates nodes of some tree, which have some other type (_Rb_tree_node<int> in GCC, for example).
In order to allocate those nodes, it has to obtain a suitable allocator. To obtain that from the allocator you provided, it uses the rebind template.
Since you derived your allocator from std::allocator, it sees the base class's rebind, which returns std::allocator<NodeType>, and that's what it uses to allocate those nodes.
(those wikipedia requirements are pretty old now, c++11 made it so much easier to write allocators)
Last edited on