Difference between std::set and boost::container::

2020-03-19 19:11发布

问题:

What is the main difference between std::set and boost::container::set ?

回答1:

The main difference between boost containers and standard containers is that boost containers allow for incomplete types. This can make a huge difference when implementing more complex data structures that rely on a combination of underlying containers.

There might be performance differences between boost containers and particular implementations of standard containers. But that could go either way.

EDIT: Here are some additional notes for set/map containers (see ref):

[multi]set/map containers are size optimized embedding the color bit of the red-black tree nodes in the parent pointer. [multi]set/map containers use no recursive functions so stack problems are avoided.



标签: c++ c++11 boost