Inside Boost.Container: comparing different deque implementations The article compares four major C++ deque implementations—libstdc++ (GCC), libc++ (Clang/LLVM), Microsoft STL (Visual Studio), and Boost.Container 1.90—highlighting their differing design choices for block sizes, iterator layout, map management, and memory reclamation. Boost's rewritten deque is the smallest at 32 bytes for an empty object on 64-bit systems, achieved by replacing fat iterators with double-ended offsets, and it offers configurable block sizes. Benchmarks show performance variations across implementations, with Boost tested in multiple block-size configurations. Many C++ developers have used std::deque , and most assume all implementations are roughly equivalent. In practice, they differ quite a bit. The three major standard library implementations — libc++ Clang/LLVM , libstdc++ GCC , and Microsoft STL Visual Studio — each make different design choices about block sizes, iterator layout, map management, and memory reclamation. Boost.Container 1.90 adds a fourth option with a recently rewritten implementation that improves performance and reduces significantly the size of an empty deque. The common architecture All four implementations share the same high-level idea: a map an array of pointers pointing to fixed-size blocks, each holding a contiguous chunk of elements. This two-level indirection is what gives deque its characteristic properties — O 1 push at both ends without invalidating references. The differences are in how each library manages those blocks. Internal data structure diagrams The key differences lie in how each implementation stores its metadata: what the map looks like, how iterators track their position, and what block size strategy they use. The diagrams below show the internal layout of each implementation for 64-bit systems. libstdc++ GCC libstdc++ stores the valid range as a pair of fat iterators. Blocks are allocated centered in the map; when one side fills up, in-use blocks are slid to re-center. libc++ Clang/LLVM libc++ uses a split buffer for the map itself — effectively a deque of block pointers. Iterators are lean 2 pointers . The valid range is tracked by start offset + size. MSVC STL Microsoft MSVC treats the map as a circular buffer — no sliding needed. The 16-byte block size is quite small compared to other implementations, and is a legacy decision the team has said they plan to revisit at the next ABI break. Iterators are proxies back to the parent deque. Boost.Container 1.90 deque rewritten Boost was rewritten for version 1.90. The previous SGI-derived layout 10 words, fat iterators was replaced with a 4-word structure using double-ended offsets m start off / m finish off into the block map, and 2-pointer iterators. The default block size was also increased to 1024 bytes on 64-bit. sizeof deque