1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>History and reasons to use Boost.Container</title> 6<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../container.html" title="Chapter 9. Boost.Container"> 10<link rel="prev" href="known_issues.html" title="Known Issues"> 11<link rel="next" href="index.html" title="Indexes"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> 16<td align="center"><a href="../../../index.html">Home</a></td> 17<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="known_issues.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../container.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="index.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="section"> 27<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 28<a name="container.history_and_reasons"></a><a class="link" href="history_and_reasons.html" title="History and reasons to use Boost.Container">History and reasons to use 29 Boost.Container</a> 30</h2></div></div></div> 31<div class="toc"><dl class="toc"> 32<dt><span class="section"><a href="history_and_reasons.html#container.history_and_reasons.boost_container_history">Boost.Container 33 history</a></span></dt> 34<dt><span class="section"><a href="history_and_reasons.html#container.history_and_reasons.Why_boost_container">Why 35 Boost.Container?</a></span></dt> 36</dl></div> 37<div class="section"> 38<div class="titlepage"><div><div><h3 class="title"> 39<a name="container.history_and_reasons.boost_container_history"></a><a class="link" href="history_and_reasons.html#container.history_and_reasons.boost_container_history" title="Boost.Container history">Boost.Container 40 history</a> 41</h3></div></div></div> 42<p> 43 <span class="bold"><strong>Boost.Container</strong></span> is a product of a long development 44 effort that started <a href="http://lists.boost.org/Archives/boost/2004/11/76263.php" target="_top">in 45 2004 with the experimental Shmem library</a>, which pioneered the use 46 of standard containers in shared memory. Shmem included modified SGI STL 47 container code tweaked to support non-raw <code class="computeroutput"><span class="identifier">allocator</span><span class="special">::</span><span class="identifier">pointer</span></code> 48 types and stateful allocators. Once reviewed, Shmem was accepted as <a href="http://www.boost.org/libs/interprocess/" target="_top">Boost.Interprocess</a> 49 and this library continued to refine and improve those containers. 50 </p> 51<p> 52 In 2007, container code from node containers (<code class="computeroutput"><span class="identifier">map</span></code>, 53 <code class="computeroutput"><span class="identifier">list</span></code>, <code class="computeroutput"><span class="identifier">slist</span></code>) 54 was rewritten, refactored and expanded to build the intrusive container library 55 <a href="http://www.boost.org/libs/intrusive/" target="_top">Boost.Intrusive</a>. 56 <span class="bold"><strong>Boost.Interprocess</strong></span> containers were refactored 57 to take advantage of <span class="bold"><strong>Boost.Intrusive</strong></span> containers 58 and code duplication was minimized. Both libraries continued to gain support 59 and bug fixes for years. They introduced move semantics, emplacement insertion 60 and more features of then unreleased C++0x standard. 61 </p> 62<p> 63 <span class="bold"><strong>Boost.Interprocess</strong></span> containers were always 64 standard compliant, and those containers and new containers like <code class="computeroutput"><span class="identifier">stable_vector</span></code> and <code class="computeroutput"><span class="identifier">flat_</span><span class="special">[</span><span class="identifier">multi</span><span class="special">]</span><span class="identifier">set</span><span class="special">/</span><span class="identifier">map</span></code> were used outside <span class="bold"><strong>Boost.Interprocess</strong></span> 65 with success. As containers were mature enough to get their own library, 66 it was a natural step to collect them containers and build <span class="bold"><strong>Boost.Container</strong></span>, 67 a library targeted to a wider audience. 68 </p> 69</div> 70<div class="section"> 71<div class="titlepage"><div><div><h3 class="title"> 72<a name="container.history_and_reasons.Why_boost_container"></a><a class="link" href="history_and_reasons.html#container.history_and_reasons.Why_boost_container" title="Why Boost.Container?">Why 73 Boost.Container?</a> 74</h3></div></div></div> 75<p> 76 With so many high quality standard library implementations out there, why 77 would you want to use <span class="bold"><strong>Boost.Container</strong></span>? There 78 are several reasons for that: 79 </p> 80<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 81<li class="listitem"> 82 Even if you have a earlier standard conforming compiler, you still can 83 have access to many of the latest C++ standard features and have an easy 84 code migration when you change your compiler. 85 </li> 86<li class="listitem"> 87 It's compatible with <span class="bold"><strong>Boost.Interprocess</strong></span> 88 shared memory allocators. 89 </li> 90<li class="listitem"> 91 You have extremely useful new containers like <code class="computeroutput"><span class="special">[</span><span class="identifier">stable</span><span class="special">/</span><span class="keyword">static</span><span class="special">/</span><span class="identifier">small</span><span class="special">]</span><span class="identifier">_vector</span></code> and <code class="computeroutput"><span class="identifier">flat_</span><span class="special">[</span><span class="identifier">multi</span><span class="special">]</span><span class="identifier">set</span><span class="special">/</span><span class="identifier">map</span></code>. 92 </li> 93<li class="listitem"> 94 If you work on multiple platforms, you'll have a portable behaviour without 95 depending on the std-lib implementation conformance of each platform. 96 Some examples: 97 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 98<li class="listitem"> 99 Default constructors don't allocate memory at all, which improves 100 performance and usually implies a no-throw guarantee (if predicate's 101 or allocator's default constructor doesn't throw). 102 </li> 103<li class="listitem"> 104 Small string optimization for <code class="computeroutput"><a class="link" href="../boost/container/basic_string.html" title="Class template basic_string">basic_string</a></code>. 105 </li> 106</ul></div> 107 </li> 108<li class="listitem"> 109 <a class="link" href="extended_functionality.html" title="Extended functionality: Basic extensions">Extended functionality</a> 110 beyond the standard based on user feedback to improve code performance. 111 </li> 112<li class="listitem"> 113 You need a portable implementation that works when compiling without 114 exceptions support or you need to customize the error handling when a 115 container needs to signal an exceptional error. 116 </li> 117</ul></div> 118</div> 119</div> 120<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 121<td align="left"></td> 122<td align="right"><div class="copyright-footer">Copyright © 2009-2018 Ion Gaztanaga<p> 123 Distributed under the Boost Software License, Version 1.0. (See accompanying 124 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 125 </p> 126</div></td> 127</tr></table> 128<hr> 129<div class="spirit-nav"> 130<a accesskey="p" href="known_issues.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../container.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="index.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> 131</div> 132</body> 133</html> 134