Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

c++11

boost

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

like image 833
Łukasz Kosiak Avatar asked Mar 22 '14 22:03

Łukasz Kosiak


1 Answers

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.

like image 166
Mikael Persson Avatar answered Oct 26 '22 14:10

Mikael Persson