3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Class template circular_buffer_space_optimized</title>
5 <link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../boost_circular_buffer_c___reference.html#header.boost.circular_buffer.space_optimized_hpp" title="Header <boost/circular_buffer/space_optimized.hpp>">
9 <link rel="prev" href="swap_idp31458912.html" title="Function template swap">
10 <link rel="next" href="../circular_buffer/s14.html" title="Index">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
15 <td align="center"><a href="../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="swap_idp31458912.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_circular_buffer_c___reference.html#header.boost.circular_buffer.space_optimized_hpp"><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="../circular_buffer/s14.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
25 <div class="refentry">
26 <a name="boost.circular_buffe_idp31480224"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Class template circular_buffer_space_optimized</span></h2>
29 <p>boost::circular_buffer_space_optimized — Space optimized circular buffer container adaptor. <code class="computeroutput">T</code> must be a copyable class or must have an noexcept move constructor and move assignment operator. </p>
31 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../boost_circular_buffer_c___reference.html#header.boost.circular_buffer.space_optimized_hpp" title="Header <boost/circular_buffer/space_optimized.hpp>">boost/circular_buffer/space_optimized.hpp</a>>
34 </span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> Alloc<span class="special">></span>
35 <span class="keyword">class</span> <a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a> <span class="special">:</span>
36 <span class="keyword">private</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">circular_buffer</span><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span>
37 <span class="special">{</span>
38 <span class="keyword">public</span><span class="special">:</span>
39 <span class="comment">// <a class="link" href="circular_buffe_idp31480224.html#boost.circular_buffe_idp31480224types">types</a></span>
40 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">value_type</span> <a name="boost.circular_buffe_idp31480224.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
41 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">pointer</span> <a name="boost.circular_buffe_idp31480224.pointer"></a><span class="identifier">pointer</span><span class="special">;</span>
42 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">const_pointer</span> <a name="boost.circular_buffe_idp31480224.const_pointer"></a><span class="identifier">const_pointer</span><span class="special">;</span>
43 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">reference</span> <a name="boost.circular_buffe_idp31480224.reference"></a><span class="identifier">reference</span><span class="special">;</span>
44 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">const_reference</span> <a name="boost.circular_buffe_idp31480224.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
45 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">size_type</span> <a name="boost.circular_buffe_idp31480224.size_type"></a><span class="identifier">size_type</span><span class="special">;</span>
46 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">difference_type</span> <a name="boost.circular_buffe_idp31480224.difference_type"></a><span class="identifier">difference_type</span><span class="special">;</span>
47 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">allocator_type</span> <a name="boost.circular_buffe_idp31480224.allocator_type"></a><span class="identifier">allocator_type</span><span class="special">;</span>
48 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">const_iterator</span> <a name="boost.circular_buffe_idp31480224.const_iterator"></a><span class="identifier">const_iterator</span><span class="special">;</span>
49 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">iterator</span> <a name="boost.circular_buffe_idp31480224.iterator"></a><span class="identifier">iterator</span><span class="special">;</span>
50 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">const_reverse_iterator</span> <a name="boost.circular_buffe_idp31480224.const_reverse_iterator"></a><span class="identifier">const_reverse_iterator</span><span class="special">;</span>
51 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">reverse_iterator</span> <a name="boost.circular_buffe_idp31480224.reverse_iterator"></a><span class="identifier">reverse_iterator</span><span class="special">;</span>
52 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">array_range</span> <a name="boost.circular_buffe_idp31480224.array_range"></a><span class="identifier">array_range</span><span class="special">;</span>
53 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">const_array_range</span> <a name="boost.circular_buffe_idp31480224.const_array_range"></a><span class="identifier">const_array_range</span><span class="special">;</span>
54 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">param_value_type</span> <a name="boost.circular_buffe_idp31480224.param_value_type"></a><span class="identifier">param_value_type</span><span class="special">;</span>
55 <span class="keyword">typedef</span> <a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span><span class="special">::</span><span class="identifier">rvalue_type</span> <a name="boost.circular_buffe_idp31480224.rvalue_type"></a><span class="identifier">rvalue_type</span><span class="special">;</span>
56 <span class="keyword">typedef</span> cb_details::capacity_control<span class="special"><</span> <span class="identifier">size_type</span> <span class="special">></span> <a class="link" href="circular_buffe_idp31480224.html#boost.circular_buffe_idp31480224.capacity_type"><span class="identifier">capacity_type</span></a><span class="special">;</span>
58 <span class="comment">// <a class="link" href="circular_buffe_idp31480224.html#boost.circular_buffe_idp31480224construct-copy-destruct">construct/copy/destruct</a></span>
59 <span class="keyword">explicit</span> <a class="link" href="circular_buffe_idp31480224.html#idp32214432-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
60 <span class="keyword">explicit</span> <a class="link" href="circular_buffe_idp31480224.html#idp32220448-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><span class="identifier">capacity_type</span><span class="special">,</span>
61 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
62 <a class="link" href="circular_buffe_idp31480224.html#idp32228992-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><span class="identifier">capacity_type</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">,</span>
63 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
64 <a class="link" href="circular_buffe_idp31480224.html#idp32241184-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><span class="identifier">capacity_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">,</span>
65 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
66 <a class="link" href="circular_buffe_idp31480224.html#idp32256048-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
67 <a class="link" href="circular_buffe_idp31480224.html#idp32264960-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
68 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
69 <a class="link" href="circular_buffe_idp31480224.html#idp32272672-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><span class="identifier">InputIterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span>
70 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
71 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
72 <a class="link" href="circular_buffe_idp31480224.html#idp32286736-bb"><span class="identifier">circular_buffer_space_optimized</span></a><span class="special">(</span><span class="identifier">capacity_type</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span>
73 <span class="identifier">InputIterator</span><span class="special">,</span>
74 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
75 <a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span>
76 <a class="link" href="circular_buffe_idp31480224.html#idp32305904-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
77 <a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span>
78 <a class="link" href="circular_buffe_idp31480224.html#idp32322240-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
80 <span class="comment">// <a class="link" href="circular_buffe_idp31480224.html#idp31516928-bb">public member functions</a></span>
81 <span class="keyword">bool</span> <a class="link" href="circular_buffe_idp31480224.html#idp31517488-bb"><span class="identifier">full</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
82 <span class="identifier">size_type</span> <a class="link" href="circular_buffe_idp31480224.html#idp31528784-bb"><span class="identifier">reserve</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
83 <span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> <a class="link" href="circular_buffe_idp31480224.html#idp31538816-bb"><span class="identifier">capacity</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
84 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31549952-bb"><span class="identifier">set_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
85 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31572144-bb"><span class="identifier">resize</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">param_value_type</span> <span class="special">=</span> <span class="identifier">value_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
86 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31594080-bb"><span class="identifier">rset_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
87 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31612032-bb"><span class="identifier">rresize</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">param_value_type</span> <span class="special">=</span> <span class="identifier">value_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
88 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31633968-bb"><span class="identifier">assign</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
89 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31652448-bb"><span class="identifier">assign</span></a><span class="special">(</span><span class="identifier">capacity_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
90 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span> <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31673680-bb"><span class="identifier">assign</span></a><span class="special">(</span><span class="identifier">InputIterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">)</span><span class="special">;</span>
91 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
92 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31693824-bb"><span class="identifier">assign</span></a><span class="special">(</span><span class="identifier">capacity_type</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">)</span><span class="special">;</span>
93 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31719696-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
94 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31733424-bb"><span class="identifier">push_back</span></a><span class="special">(</span><span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
95 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31748496-bb"><span class="identifier">push_back</span></a><span class="special">(</span><span class="identifier">rvalue_type</span><span class="special">)</span><span class="special">;</span>
96 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31763104-bb"><span class="identifier">push_back</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
97 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31777952-bb"><span class="identifier">push_front</span></a><span class="special">(</span><span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
98 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31793024-bb"><span class="identifier">push_front</span></a><span class="special">(</span><span class="identifier">rvalue_type</span><span class="special">)</span><span class="special">;</span>
99 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31808544-bb"><span class="identifier">push_front</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
100 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31823392-bb"><span class="identifier">pop_back</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
101 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31836048-bb"><span class="identifier">pop_front</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
102 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp31848704-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
103 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp31872608-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">rvalue_type</span><span class="special">)</span><span class="special">;</span>
104 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp31896496-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
105 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31919712-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
106 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
107 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp31951152-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">)</span><span class="special">;</span>
108 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp31988656-bb"><span class="identifier">rinsert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
109 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp32012544-bb"><span class="identifier">rinsert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">rvalue_type</span><span class="special">)</span><span class="special">;</span>
110 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp32036416-bb"><span class="identifier">rinsert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
111 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32059616-bb"><span class="identifier">rinsert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">param_value_type</span><span class="special">)</span><span class="special">;</span>
112 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
113 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32091024-bb"><span class="identifier">rinsert</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">)</span><span class="special">;</span>
114 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp32128528-bb"><span class="identifier">erase</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
115 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp32145520-bb"><span class="identifier">erase</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
116 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp32163296-bb"><span class="identifier">rerase</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
117 <span class="identifier">iterator</span> <a class="link" href="circular_buffe_idp31480224.html#idp32182256-bb"><span class="identifier">rerase</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
118 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32202176-bb"><span class="identifier">clear</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
120 <span class="comment">// <a class="link" href="circular_buffe_idp31480224.html#idp32330288-bb">private member functions</a></span>
121 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32330864-bb"><span class="identifier">adjust_min_capacity</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
122 <span class="identifier">size_type</span> <a class="link" href="circular_buffe_idp31480224.html#idp32332016-bb"><span class="identifier">ensure_reserve</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
123 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32334832-bb"><span class="identifier">check_low_capacity</span></a><span class="special">(</span><span class="identifier">size_type</span> <span class="special">=</span> <span class="number">1</span><span class="special">)</span><span class="special">;</span>
124 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32336960-bb"><span class="identifier">check_high_capacity</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
125 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32338112-bb"><span class="identifier">reduce_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
126 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32339968-bb"><span class="identifier">reduce_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
127 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> IntegralType<span class="special">></span>
128 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32341824-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">IntegralType</span><span class="special">,</span> <span class="identifier">IntegralType</span><span class="special">,</span>
129 <span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
130 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
131 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32346576-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
132 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> IntegralType<span class="special">></span>
133 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32351328-bb"><span class="identifier">rinsert</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">IntegralType</span><span class="special">,</span> <span class="identifier">IntegralType</span><span class="special">,</span>
134 <span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
135 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
136 <span class="keyword">void</span> <a class="link" href="circular_buffe_idp31480224.html#idp32356080-bb"><span class="identifier">rinsert</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
138 <span class="comment">// <a class="link" href="circular_buffe_idp31480224.html#idp32360992-bb">private static functions</a></span>
139 <span class="keyword">static</span> <span class="identifier">size_type</span> <a class="link" href="circular_buffe_idp31480224.html#idp32361568-bb"><span class="identifier">init_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
140 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> IntegralType<span class="special">></span>
141 <span class="keyword">static</span> <span class="identifier">size_type</span>
142 <a class="link" href="circular_buffe_idp31480224.html#idp32364368-bb"><span class="identifier">init_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">IntegralType</span><span class="special">,</span> <span class="identifier">IntegralType</span><span class="special">,</span>
143 <span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
144 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
145 <span class="keyword">static</span> <span class="identifier">size_type</span>
146 <a class="link" href="circular_buffe_idp31480224.html#idp32369424-bb"><span class="identifier">init_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">,</span>
147 <span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
148 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
149 <span class="keyword">static</span> <span class="identifier">size_type</span>
150 <a class="link" href="circular_buffe_idp31480224.html#idp32374480-bb"><span class="identifier">init_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span>
151 <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">input_iterator_tag</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
152 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> ForwardIterator<span class="special">></span>
153 <span class="keyword">static</span> <span class="identifier">size_type</span>
154 <a class="link" href="circular_buffe_idp31480224.html#idp32379552-bb"><span class="identifier">init_capacity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">ForwardIterator</span><span class="special">,</span> <span class="identifier">ForwardIterator</span><span class="special">,</span>
155 <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward_iterator_tag</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
156 <span class="special">}</span><span class="special">;</span></pre></div>
157 <div class="refsect1">
158 <a name="idp146544208"></a><h2>Description</h2>
159 <div class="refsect2">
160 <a name="idp146544624"></a><h3>
161 <a name="boost.circular_buffe_idp31480224types"></a><code class="computeroutput">circular_buffer_space_optimized</code>
164 <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
166 <span class="keyword">typedef</span> cb_details::capacity_control<span class="special"><</span> <span class="identifier">size_type</span> <span class="special">></span> <a name="boost.circular_buffe_idp31480224.capacity_type"></a><span class="identifier">capacity_type</span><span class="special">;</span></p>
167 <p>Capacity controller of the space optimized circular buffer.</p>
168 <p><span class="bold"><strong>See Also:</strong></span></p>
169 <p>capacity_control in details.hpp. </p>
171 <code class="computeroutput"> class capacity_control<br>
173 size_type m_capacity; // Available capacity.<br>
174 size_type m_min_capacity; // Minimum capacity.<br>
176 capacity_control(size_type capacity, size_type min_capacity = 0)<br>
177 : m_capacity(capacity), m_min_capacity(min_capacity)<br>
179 size_type capacity() const { return m_capacity; }<br>
180 size_type min_capacity() const { return m_min_capacity; }<br>
181 operator size_type() const { return m_capacity; }<br>
184 <p>Always <code class="computeroutput">capacity >= min_capacity</code>. </p>
185 <p>The <code class="computeroutput">capacity()</code> represents the capacity of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> and the <code class="computeroutput">min_capacity()</code> determines the minimal allocated size of its internal buffer. </p>
186 <p>The converting constructor of the <code class="computeroutput">capacity_control</code> allows implicit conversion from <code class="computeroutput">size_type</code>-like types which ensures compatibility of creating an instance of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> with other STL containers.</p>
187 <p>On the other hand the operator <code class="computeroutput">size_type()</code> provides implicit conversion to the <code class="computeroutput">size_type</code> which allows to treat the capacity of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> the same way as in the <code class="computeroutput"><a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a></code>. </p>
190 <div class="refsect2">
191 <a name="idp146569248"></a><h3>
192 <a name="boost.circular_buffe_idp31480224construct-copy-destruct"></a><code class="computeroutput">circular_buffer_space_optimized</code>
194 construct/copy/destruct</h3>
195 <div class="orderedlist"><ol class="orderedlist" type="1">
196 <li class="listitem">
197 <pre class="literallayout"><span class="keyword">explicit</span> <a name="idp32214432-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> alloc <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Create an empty space optimized circular buffer with zero capacity. <p>
201 <p><b>Complexity. </b>Constant. </p>
204 <div class="warning"><table border="0" summary="Warning">
206 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
207 <th align="left">Warning</th>
209 <tr><td align="left" valign="top"><p>Since Boost version 1.36 the behaviour of this constructor has changed. Now it creates a space optimized circular buffer with zero capacity. </p></td></tr>
213 <div class="variablelist"><table border="0" class="variablelist compact">
215 <col align="left" valign="top">
220 <td><p><span class="term">Parameters:</span></p></td>
221 <td><div class="variablelist"><table border="0" class="variablelist compact">
223 <col align="left" valign="top">
227 <td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
228 <td><p>The allocator. </p></td>
233 <td><p><span class="term">Postconditions:</span></p></td>
234 <td><p><code class="computeroutput">capacity().capacity() == 0 && capacity().min_capacity() == 0 && size() == 0</code> </p></td>
237 <td><p><span class="term">Throws:</span></p></td>
243 <li class="listitem">
244 <pre class="literallayout"><span class="keyword">explicit</span> <a name="idp32220448-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><span class="identifier">capacity_type</span> capacity_ctrl<span class="special">,</span>
245 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> alloc <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Create an empty space optimized circular buffer with the specified capacity. <p>
249 <p><b>Complexity. </b>Constant. </p>
252 <div class="variablelist"><table border="0" class="variablelist compact">
254 <col align="left" valign="top">
259 <td><p><span class="term">Parameters:</span></p></td>
260 <td><div class="variablelist"><table border="0" class="variablelist compact">
262 <col align="left" valign="top">
267 <td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
268 <td><p>The allocator. </p></td>
271 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
272 <td><p>The capacity controller representing the maximum number of elements which can be stored in the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> and the minimal allocated size of the internal buffer. </p></td>
278 <td><p><span class="term">Postconditions:</span></p></td>
279 <td><p><code class="computeroutput">capacity() == capacity_ctrl && size() == 0</code><br>
281 The amount of allocated memory in the internal buffer is <code class="computeroutput">capacity_ctrl.min_capacity()</code>. </p></td>
284 <td><p><span class="term">Throws:</span></p></td>
285 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). </td>
290 <li class="listitem">
291 <pre class="literallayout"><a name="idp32228992-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><span class="identifier">capacity_type</span> capacity_ctrl<span class="special">,</span>
292 <span class="identifier">param_value_type</span> item<span class="special">,</span>
293 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> alloc <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Create a full space optimized circular buffer with the specified capacity filled with <code class="computeroutput">capacity_ctrl.capacity()</code> copies of <code class="computeroutput">item</code>. <p>
297 <p><b>Complexity. </b>Linear (in the <code class="computeroutput">capacity_ctrl.capacity()</code>). </p>
300 <div class="variablelist"><table border="0" class="variablelist compact">
302 <col align="left" valign="top">
307 <td><p><span class="term">Parameters:</span></p></td>
308 <td><div class="variablelist"><table border="0" class="variablelist compact">
310 <col align="left" valign="top">
315 <td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
316 <td><p>The allocator. </p></td>
319 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
320 <td><p>The capacity controller representing the maximum number of elements which can be stored in the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> and the minimal allocated size of the internal buffer. </p></td>
323 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
324 <td><p>The element the created <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with. </p></td>
330 <td><p><span class="term">Postconditions:</span></p></td>
331 <td><p><code class="computeroutput">capacity() == capacity_ctrl && full() && (*this)[0] == item && (*this)[1] == item && ... && (*this) [capacity_ctrl.capacity() - 1] == item </code><br>
333 The amount of allocated memory in the internal buffer is <code class="computeroutput">capacity_ctrl.capacity()</code>. </p></td>
336 <td><p><span class="term">Throws:</span></p></td>
337 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). <code class="computeroutput">T::T(const T&)</code> throws. </td>
342 <li class="listitem">
343 <pre class="literallayout"><a name="idp32241184-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><span class="identifier">capacity_type</span> capacity_ctrl<span class="special">,</span> <span class="identifier">size_type</span> n<span class="special">,</span>
344 <span class="identifier">param_value_type</span> item<span class="special">,</span>
345 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> alloc <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Create a space optimized circular buffer with the specified capacity filled with <code class="computeroutput">n</code> copies of <code class="computeroutput">item</code>. <p>
350 <p><b>Complexity. </b>Linear (in the <code class="computeroutput">n</code>). </p>
353 <div class="variablelist"><table border="0" class="variablelist compact">
355 <col align="left" valign="top">
360 <td><p><span class="term">Parameters:</span></p></td>
361 <td><div class="variablelist"><table border="0" class="variablelist compact">
363 <col align="left" valign="top">
368 <td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
369 <td><p>The allocator. </p></td>
372 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
373 <td><p>The capacity controller representing the maximum number of elements which can be stored in the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> and the minimal allocated size of the internal buffer. </p></td>
376 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
377 <td><p>The element the created <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with. </p></td>
380 <td><p><span class="term"><code class="computeroutput">n</code></span></p></td>
381 <td><p>The number of elements the created <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with. </p></td>
387 <td><p><span class="term">Requires:</span></p></td>
388 <td><p><code class="computeroutput">capacity_ctrl.capacity() >= n</code> </p></td>
391 <td><p><span class="term">Postconditions:</span></p></td>
392 <td><p><code class="computeroutput">capacity() == capacity_ctrl && size() == n && (*this)[0] == item && (*this)[1] == item && ... && (*this)[n - 1] == item</code><br>
394 The amount of allocated memory in the internal buffer is <code class="computeroutput">max[n, capacity_ctrl.min_capacity()]</code>. </p></td>
397 <td><p><span class="term">Throws:</span></p></td>
398 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
403 <li class="listitem">
404 <pre class="literallayout"><a name="idp32256048-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span> cb<span class="special">)</span><span class="special">;</span></pre>The copy constructor. <p>Creates a copy of the specified <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>.
408 <p><b>Complexity. </b>Linear (in the size of <code class="computeroutput">cb</code>). </p>
411 <div class="variablelist"><table border="0" class="variablelist compact">
413 <col align="left" valign="top">
418 <td><p><span class="term">Parameters:</span></p></td>
419 <td><div class="variablelist"><table border="0" class="variablelist compact">
421 <col align="left" valign="top">
425 <td><p><span class="term"><code class="computeroutput">cb</code></span></p></td>
426 <td><p>The <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> to be copied. </p></td>
431 <td><p><span class="term">Postconditions:</span></p></td>
432 <td><p><code class="computeroutput">*this == cb</code><br>
434 The amount of allocated memory in the internal buffer is <code class="computeroutput">cb.size()</code>. </p></td>
437 <td><p><span class="term">Throws:</span></p></td>
438 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
443 <li class="listitem">
444 <pre class="literallayout"><a name="idp32264960-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&&</span> cb<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>The move constructor. <p>Move constructs a <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> from <code class="computeroutput">cb</code>, leaving <code class="computeroutput">cb</code> empty.
449 <p><b>Constant. </b></p>
452 <div class="variablelist"><table border="0" class="variablelist compact">
454 <col align="left" valign="top">
459 <td><p><span class="term">Parameters:</span></p></td>
460 <td><div class="variablelist"><table border="0" class="variablelist compact">
462 <col align="left" valign="top">
466 <td><p><span class="term"><code class="computeroutput">cb</code></span></p></td>
467 <td><p><code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a></code></code> to 'steal' value from. </p></td>
472 <td><p><span class="term">Requires:</span></p></td>
473 <td><p>C++ compiler with rvalue references support. </p></td>
476 <td><p><span class="term">Postconditions:</span></p></td>
477 <td><p><code class="computeroutput">cb.empty()</code> </p></td>
480 <td><p><span class="term">Throws:</span></p></td>
486 <li class="listitem">
487 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
488 <a name="idp32272672-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><span class="identifier">InputIterator</span> first<span class="special">,</span> <span class="identifier">InputIterator</span> last<span class="special">,</span>
489 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> alloc <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Create a full space optimized circular buffer filled with a copy of the range. <p>
494 <p><b>Complexity. </b>Linear (in the <code class="computeroutput">std::distance(first, last)</code>). </p>
497 <div class="variablelist"><table border="0" class="variablelist compact">
499 <col align="left" valign="top">
504 <td><p><span class="term">Parameters:</span></p></td>
505 <td><div class="variablelist"><table border="0" class="variablelist compact">
507 <col align="left" valign="top">
512 <td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
513 <td><p>The allocator. </p></td>
516 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
517 <td><p>The beginning of the range to be copied. </p></td>
520 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
521 <td><p>The end of the range to be copied. </p></td>
527 <td><p><span class="term">Requires:</span></p></td>
528 <td><p>Valid range <code class="computeroutput">[first, last)</code>.<br>
529 <code class="computeroutput">first</code> and <code class="computeroutput">last</code> have to meet the requirements of <a href="http://www.sgi.com/tech/stl/InputIterator.html" target="_top">InputIterator</a>. </p></td>
532 <td><p><span class="term">Postconditions:</span></p></td>
533 <td><p><code class="computeroutput">capacity().capacity() == std::distance(first, last) && capacity().min_capacity() == 0 && full() && (*this)[0]== *first && (*this)[1] == *(first + 1) && ... && (*this)[std::distance(first, last) - 1] == *(last - 1)</code><br>
535 The amount of allocated memory in the internal buffer is <code class="computeroutput">std::distance(first, last)</code>. </p></td>
538 <td><p><span class="term">Throws:</span></p></td>
539 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept and <code class="computeroutput">InputIterator</code> is a move iterator. </td>
544 <li class="listitem">
545 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
546 <a name="idp32286736-bb"></a><span class="identifier">circular_buffer_space_optimized</span><span class="special">(</span><span class="identifier">capacity_type</span> capacity_ctrl<span class="special">,</span>
547 <span class="identifier">InputIterator</span> first<span class="special">,</span> <span class="identifier">InputIterator</span> last<span class="special">,</span>
548 <span class="keyword">const</span> <span class="identifier">allocator_type</span> <span class="special">&</span> alloc <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Create a space optimized circular buffer with the specified capacity (and the minimal guaranteed amount of allocated memory) filled with a copy of the range. <p>
553 <p><b>Complexity. </b>Linear (in <code class="computeroutput">std::distance(first, last)</code>; in <code class="computeroutput">min[capacity_ctrl.capacity(), std::distance(first, last)]</code> if the <code class="computeroutput">InputIterator</code> is a <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html" target="_top">RandomAccessIterator</a>). </p>
556 <div class="variablelist"><table border="0" class="variablelist compact">
558 <col align="left" valign="top">
563 <td><p><span class="term">Parameters:</span></p></td>
564 <td><div class="variablelist"><table border="0" class="variablelist compact">
566 <col align="left" valign="top">
571 <td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
572 <td><p>The allocator. </p></td>
575 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
576 <td><p>The capacity controller representing the maximum number of elements which can be stored in the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> and the minimal allocated size of the internal buffer. </p></td>
579 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
580 <td><p>The beginning of the range to be copied. </p></td>
583 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
584 <td><p>The end of the range to be copied. </p></td>
590 <td><p><span class="term">Requires:</span></p></td>
591 <td><p>Valid range <code class="computeroutput">[first, last)</code>.<br>
592 <code class="computeroutput">first</code> and <code class="computeroutput">last</code> have to meet the requirements of <a href="http://www.sgi.com/tech/stl/InputIterator.html" target="_top">InputIterator</a>. </p></td>
595 <td><p><span class="term">Postconditions:</span></p></td>
596 <td><p><code class="computeroutput">capacity() == capacity_ctrl && size() <= std::distance(first, last) && (*this)[0]== (last - capacity_ctrl.capacity()) && (*this)[1] == *(last - capacity_ctrl.capacity() + 1) && ... && (*this)[capacity_ctrl.capacity() - 1] == *(last - 1)</code><br>
598 If the number of items to be copied from the range <code class="computeroutput">[first, last)</code> is greater than the specified <code class="computeroutput">capacity_ctrl.capacity()</code> then only elements from the range <code class="computeroutput">[last - capacity_ctrl.capacity(), last)</code> will be copied.<br>
600 The amount of allocated memory in the internal buffer is <code class="computeroutput">max[capacity_ctrl.min_capacity(), min[capacity_ctrl.capacity(), std::distance(first, last)]]</code>. </p></td>
603 <td><p><span class="term">Throws:</span></p></td>
604 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
609 <li class="listitem">
610 <pre class="literallayout"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span>
611 <a name="idp32305904-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span> cb<span class="special">)</span><span class="special">;</span></pre>The assign operator. <p>Makes this <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> to become a copy of the specified <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>.
615 <p><b>Exception Safety. </b>Strong. </p>
618 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to this <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
621 <p><b>Complexity. </b>Linear (in the size of <code class="computeroutput">cb</code>). </p>
624 <p><span class="bold"><strong>See Also:</strong></span></p>
625 <p><code class="computeroutput">assign(size_type, const_reference)</code>, <code class="computeroutput">assign(capacity_type, size_type, const_reference)</code>, <code class="computeroutput">assign(InputIterator, InputIterator)</code>, <code class="computeroutput">assign(capacity_type, InputIterator, InputIterator)</code> </p>
628 <div class="variablelist"><table border="0" class="variablelist compact">
630 <col align="left" valign="top">
635 <td><p><span class="term">Parameters:</span></p></td>
636 <td><div class="variablelist"><table border="0" class="variablelist compact">
638 <col align="left" valign="top">
642 <td><p><span class="term"><code class="computeroutput">cb</code></span></p></td>
643 <td><p>The <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> to be copied. </p></td>
648 <td><p><span class="term">Postconditions:</span></p></td>
649 <td><p><code class="computeroutput">*this == cb</code><br>
651 The amount of allocated memory in the internal buffer is <code class="computeroutput">cb.size()</code>. </p></td>
654 <td><p><span class="term">Throws:</span></p></td>
655 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). <code class="computeroutput">T::T(const T&)</code> throws. </td>
660 <li class="listitem">
661 <pre class="literallayout"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span>
662 <a name="idp32322240-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&&</span> cb<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Move assigns content of <code class="computeroutput">cb</code> to <code class="computeroutput">*this</code>, leaving <code class="computeroutput">cb</code> empty. <p>
667 <p><b>Complexity. </b>Constant. </p>
670 <div class="variablelist"><table border="0" class="variablelist compact">
672 <col align="left" valign="top">
677 <td><p><span class="term">Parameters:</span></p></td>
678 <td><div class="variablelist"><table border="0" class="variablelist compact">
680 <col align="left" valign="top">
684 <td><p><span class="term"><code class="computeroutput">cb</code></span></p></td>
685 <td><p><code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a></code></code> to 'steal' value from. </p></td>
690 <td><p><span class="term">Requires:</span></p></td>
691 <td><p>C++ compiler with rvalue references support. </p></td>
694 <td><p><span class="term">Postconditions:</span></p></td>
695 <td><p><code class="computeroutput">cb.empty()</code> </p></td>
698 <td><p><span class="term">Throws:</span></p></td>
706 <div class="refsect2">
707 <a name="idp146846544"></a><h3>
708 <a name="idp31516928-bb"></a><code class="computeroutput">circular_buffer_space_optimized</code> public member functions</h3>
709 <div class="orderedlist"><ol class="orderedlist" type="1">
710 <li class="listitem">
711 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp31517488-bb"></a><span class="identifier">full</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Is the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> full? <p>
714 <p><b>Exception Safety. </b>No-throw. </p>
717 <p><b>Iterator Invalidation. </b>Does not invalidate any iterators. </p>
720 <p><b>Complexity. </b>Constant (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
723 <p><span class="bold"><strong>See Also:</strong></span></p>
724 <p><code class="computeroutput">empty()</code> </p>
727 <div class="variablelist"><table border="0" class="variablelist compact">
729 <col align="left" valign="top">
734 <td><p><span class="term">Returns:</span></p></td>
735 <td><p><code class="computeroutput">true</code> if the number of elements stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> equals the capacity of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code>; <code class="computeroutput">false</code> otherwise. </p></td>
738 <td><p><span class="term">Throws:</span></p></td>
744 <li class="listitem">
745 <pre class="literallayout"><span class="identifier">size_type</span> <a name="idp31528784-bb"></a><span class="identifier">reserve</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Get the maximum number of elements which can be inserted into the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> without overwriting any of already stored elements. <p>
748 <p><b>Exception Safety. </b>No-throw. </p>
751 <p><b>Iterator Invalidation. </b>Does not invalidate any iterators. </p>
754 <p><b>Complexity. </b>Constant (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
757 <p><span class="bold"><strong>See Also:</strong></span></p>
758 <p><code class="computeroutput">capacity()</code>, <code class="computeroutput">size()</code>, <code class="computeroutput">max_size()</code> </p>
761 <div class="variablelist"><table border="0" class="variablelist compact">
763 <col align="left" valign="top">
768 <td><p><span class="term">Returns:</span></p></td>
769 <td><p><code class="computeroutput">capacity().capacity() - size()</code> </p></td>
772 <td><p><span class="term">Throws:</span></p></td>
778 <li class="listitem">
779 <pre class="literallayout"><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> <a name="idp31538816-bb"></a><span class="identifier">capacity</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Get the capacity of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>. <p>
782 <p><b>Exception Safety. </b>No-throw. </p>
785 <p><b>Iterator Invalidation. </b>Does not invalidate any iterators. </p>
788 <p><b>Complexity. </b>Constant (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
791 <p><span class="bold"><strong>See Also:</strong></span></p>
792 <p><code class="computeroutput">reserve()</code>, <code class="computeroutput">size()</code>, <code class="computeroutput">max_size()</code>, <code class="computeroutput">set_capacity(const capacity_type&)</code> </p>
795 <div class="variablelist"><table border="0" class="variablelist compact">
797 <col align="left" valign="top">
802 <td><p><span class="term">Returns:</span></p></td>
803 <td><p>The capacity controller representing the maximum number of elements which can be stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> and the minimal allocated size of the internal buffer. </p></td>
806 <td><p><span class="term">Throws:</span></p></td>
812 <li class="listitem">
813 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31549952-bb"></a><span class="identifier">set_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> capacity_ctrl<span class="special">)</span><span class="special">;</span></pre>Change the capacity (and the minimal guaranteed amount of allocated memory) of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>. <p>
817 <p><b>Exception Safety. </b>Strong. </p>
820 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
823 <p><b>Complexity. </b>Linear (in <code class="computeroutput">min[size(), capacity_ctrl.capacity()]</code>). </p>
826 <div class="note"><table border="0" summary="Note">
828 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/src/images/note.png"></td>
829 <th align="left">Note</th>
831 <tr><td align="left" valign="top"><p>To explicitly clear the extra allocated memory use the <span class="bold"><strong>shrink-to-fit</strong></span> technique:<br>
833 <code class="computeroutput">boost::circular_buffer_space_optimized<int> cb(1000);<br>
835 boost::circular_buffer_space_optimized<int>(cb).swap(cb);</code><br>
837 For more information about the shrink-to-fit technique in STL see <a href="http://www.gotw.ca/gotw/054.htm" target="_top">http://www.gotw.ca/gotw/054.htm</a>. </p></td></tr>
841 <p><span class="bold"><strong>See Also:</strong></span></p>
842 <p><code class="computeroutput">rset_capacity(const capacity_type&)</code>, <code class="computeroutput">resize(size_type, const_reference)</code> </p>
845 <div class="variablelist"><table border="0" class="variablelist compact">
847 <col align="left" valign="top">
852 <td><p><span class="term">Parameters:</span></p></td>
853 <td><div class="variablelist"><table border="0" class="variablelist compact">
855 <col align="left" valign="top">
859 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
860 <td><p>The new capacity controller. </p></td>
865 <td><p><span class="term">Postconditions:</span></p></td>
866 <td><p><code class="computeroutput">capacity() == capacity_ctrl && size() <= capacity_ctrl.capacity()</code><br>
868 If the current number of elements stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is greater than the desired new capacity then number of <code class="computeroutput">[size() - capacity_ctrl.capacity()]</code> <span class="bold"><strong>last</strong></span> elements will be removed and the new size will be equal to <code class="computeroutput">capacity_ctrl.capacity()</code>.<br>
870 If the current number of elements stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is lower than the new capacity then the amount of allocated memory in the internal buffer may be accommodated as necessary but it will never drop below <code class="computeroutput">capacity_ctrl.min_capacity()</code>. </p></td>
873 <td><p><span class="term">Throws:</span></p></td>
874 <td>An allocation error if memory is exhausted, (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
879 <li class="listitem">
880 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31572144-bb"></a><span class="identifier">resize</span><span class="special">(</span><span class="identifier">size_type</span> new_size<span class="special">,</span> <span class="identifier">param_value_type</span> item <span class="special">=</span> <span class="identifier">value_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Change the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>. <p>
884 <p><b>Exception Safety. </b>Basic. </p>
887 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
890 <p><b>Complexity. </b>Linear (in the new size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
893 <p><span class="bold"><strong>See Also:</strong></span></p>
894 <p><code class="computeroutput">rresize(size_type, const_reference)</code>, <code class="computeroutput">set_capacity(const capacity_type&)</code> </p>
897 <div class="variablelist"><table border="0" class="variablelist compact">
899 <col align="left" valign="top">
904 <td><p><span class="term">Parameters:</span></p></td>
905 <td><div class="variablelist"><table border="0" class="variablelist compact">
907 <col align="left" valign="top">
912 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
913 <td><p>The element the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with in order to gain the requested size. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
916 <td><p><span class="term"><code class="computeroutput">new_size</code></span></p></td>
917 <td><p>The new size. </p></td>
923 <td><p><span class="term">Postconditions:</span></p></td>
924 <td><p><code class="computeroutput">size() == new_size && capacity().capacity() >= new_size</code><br>
926 If the new size is greater than the current size, copies of <code class="computeroutput">item</code> will be inserted at the <span class="bold"><strong>back</strong></span> of the of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to <code class="computeroutput">new_size</code>.<br>
928 If the current number of elements stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is greater than the desired new size then number of <code class="computeroutput">[size() - new_size]</code> <span class="bold"><strong>last</strong></span> elements will be removed. (The capacity will remain unchanged.)<br>
930 The amount of allocated memory in the internal buffer may be accommodated as necessary. </p></td>
933 <td><p><span class="term">Throws:</span></p></td>
934 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
939 <li class="listitem">
940 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31594080-bb"></a><span class="identifier">rset_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> capacity_ctrl<span class="special">)</span><span class="special">;</span></pre>Change the capacity (and the minimal guaranteed amount of allocated memory) of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>. <p>
944 <p><b>Exception Safety. </b>Strong. </p>
947 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
950 <p><b>Complexity. </b>Linear (in <code class="computeroutput">min[size(), capacity_ctrl.capacity()]</code>). </p>
953 <p><span class="bold"><strong>See Also:</strong></span></p>
954 <p><code class="computeroutput">set_capacity(const capacity_type&)</code>, <code class="computeroutput">rresize(size_type, const_reference)</code> </p>
957 <div class="variablelist"><table border="0" class="variablelist compact">
959 <col align="left" valign="top">
964 <td><p><span class="term">Parameters:</span></p></td>
965 <td><div class="variablelist"><table border="0" class="variablelist compact">
967 <col align="left" valign="top">
971 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
972 <td><p>The new capacity controller. </p></td>
977 <td><p><span class="term">Postconditions:</span></p></td>
978 <td><p><code class="computeroutput">capacity() == capacity_ctrl && size() <= capacity_ctrl</code><br>
980 If the current number of elements stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is greater than the desired new capacity then number of <code class="computeroutput">[size() - capacity_ctrl.capacity()]</code> <span class="bold"><strong>first</strong></span> elements will be removed and the new size will be equal to <code class="computeroutput">capacity_ctrl.capacity()</code>.<br>
982 If the current number of elements stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is lower than the new capacity then the amount of allocated memory in the internal buffer may be accommodated as necessary but it will never drop below <code class="computeroutput">capacity_ctrl.min_capacity()</code>. </p></td>
985 <td><p><span class="term">Throws:</span></p></td>
986 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
991 <li class="listitem">
992 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31612032-bb"></a><span class="identifier">rresize</span><span class="special">(</span><span class="identifier">size_type</span> new_size<span class="special">,</span> <span class="identifier">param_value_type</span> item <span class="special">=</span> <span class="identifier">value_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Change the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>. <p>
996 <p><b>Exception Safety. </b>Basic. </p>
999 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1002 <p><b>Complexity. </b>Linear (in the new size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1005 <p><span class="bold"><strong>See Also:</strong></span></p>
1006 <p><code class="computeroutput">resize(size_type, const_reference)</code>, <code class="computeroutput">rset_capacity(const capacity_type&)</code> </p>
1009 <div class="variablelist"><table border="0" class="variablelist compact">
1011 <col align="left" valign="top">
1016 <td><p><span class="term">Parameters:</span></p></td>
1017 <td><div class="variablelist"><table border="0" class="variablelist compact">
1019 <col align="left" valign="top">
1024 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1025 <td><p>The element the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with in order to gain the requested size. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
1028 <td><p><span class="term"><code class="computeroutput">new_size</code></span></p></td>
1029 <td><p>The new size. </p></td>
1035 <td><p><span class="term">Postconditions:</span></p></td>
1036 <td><p><code class="computeroutput">size() == new_size && capacity().capacity() >= new_size</code><br>
1038 If the new size is greater than the current size, copies of <code class="computeroutput">item</code> will be inserted at the <span class="bold"><strong>front</strong></span> of the of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to <code class="computeroutput">new_size</code>.<br>
1040 If the current number of elements stored in the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is greater than the desired new size then number of <code class="computeroutput">[size() - new_size]</code> <span class="bold"><strong>first</strong></span> elements will be removed. (The capacity will remain unchanged.)<br>
1042 The amount of allocated memory in the internal buffer may be accommodated as necessary. </p></td>
1045 <td><p><span class="term">Throws:</span></p></td>
1046 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
1051 <li class="listitem">
1052 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31633968-bb"></a><span class="identifier">assign</span><span class="special">(</span><span class="identifier">size_type</span> n<span class="special">,</span> <span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Assign <code class="computeroutput">n</code> items into the space optimized circular buffer. <p>The content of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be removed and replaced with <code class="computeroutput">n</code> copies of the <code class="computeroutput">item</code>.
1056 <p><b>Exception Safety. </b>Basic. </p>
1059 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1062 <p><b>Complexity. </b>Linear (in the <code class="computeroutput">n</code>). </p>
1065 <p><span class="bold"><strong>See Also:</strong></span></p>
1066 <p><code class="computeroutput">operator=</code>, <code class="computeroutput">assign(capacity_type, size_type, const_reference)</code>, <code class="computeroutput">assign(InputIterator, InputIterator)</code>, <code class="computeroutput">assign(capacity_type, InputIterator, InputIterator)</code> </p>
1069 <div class="variablelist"><table border="0" class="variablelist compact">
1071 <col align="left" valign="top">
1076 <td><p><span class="term">Parameters:</span></p></td>
1077 <td><div class="variablelist"><table border="0" class="variablelist compact">
1079 <col align="left" valign="top">
1084 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1085 <td><p>The element the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with. </p></td>
1088 <td><p><span class="term"><code class="computeroutput">n</code></span></p></td>
1089 <td><p>The number of elements the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with. </p></td>
1095 <td><p><span class="term">Postconditions:</span></p></td>
1096 <td><p><code class="computeroutput">capacity().capacity() == n && capacity().min_capacity() == 0 && size() == n && (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1] == item</code><br>
1098 The amount of allocated memory in the internal buffer is <code class="computeroutput">n</code>. </p></td>
1101 <td><p><span class="term">Throws:</span></p></td>
1102 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
1107 <li class="listitem">
1108 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31652448-bb"></a><span class="identifier">assign</span><span class="special">(</span><span class="identifier">capacity_type</span> capacity_ctrl<span class="special">,</span> <span class="identifier">size_type</span> n<span class="special">,</span> <span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Assign <code class="computeroutput">n</code> items into the space optimized circular buffer specifying the capacity. <p>The capacity of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be set to the specified value and the content of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be removed and replaced with <code class="computeroutput">n</code> copies of the <code class="computeroutput">item</code>.
1113 <p><b>Exception Safety. </b>Basic. </p>
1116 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1119 <p><b>Complexity. </b>Linear (in the <code class="computeroutput">n</code>). </p>
1122 <p><span class="bold"><strong>See Also:</strong></span></p>
1123 <p><code class="computeroutput">operator=</code>, <code class="computeroutput">assign(size_type, const_reference)</code>, <code class="computeroutput">assign(InputIterator, InputIterator)</code>, <code class="computeroutput">assign(capacity_type, InputIterator, InputIterator)</code> </p>
1126 <div class="variablelist"><table border="0" class="variablelist compact">
1128 <col align="left" valign="top">
1133 <td><p><span class="term">Parameters:</span></p></td>
1134 <td><div class="variablelist"><table border="0" class="variablelist compact">
1136 <col align="left" valign="top">
1141 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
1142 <td><p>The new capacity controller. </p></td>
1145 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1146 <td><p>The element the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with. </p></td>
1149 <td><p><span class="term"><code class="computeroutput">n</code></span></p></td>
1150 <td><p>The number of elements the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be filled with. </p></td>
1156 <td><p><span class="term">Requires:</span></p></td>
1157 <td><p><code class="computeroutput">capacity_ctrl.capacity() >= n</code> </p></td>
1160 <td><p><span class="term">Postconditions:</span></p></td>
1161 <td><p><code class="computeroutput">capacity() == capacity_ctrl && size() == n && (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1] == item </code><br>
1163 The amount of allocated memory will be <code class="computeroutput">max[n, capacity_ctrl.min_capacity()]</code>. </p></td>
1166 <td><p><span class="term">Throws:</span></p></td>
1167 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
1172 <li class="listitem">
1173 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
1174 <span class="keyword">void</span> <a name="idp31673680-bb"></a><span class="identifier">assign</span><span class="special">(</span><span class="identifier">InputIterator</span> first<span class="special">,</span> <span class="identifier">InputIterator</span> last<span class="special">)</span><span class="special">;</span></pre>Assign a copy of the range into the space optimized circular buffer. <p>The content of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be removed and replaced with copies of elements from the specified range.
1179 <p><b>Exception Safety. </b>Basic. </p>
1182 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1185 <p><b>Complexity. </b>Linear (in the <code class="computeroutput">std::distance(first, last)</code>). </p>
1188 <p><span class="bold"><strong>See Also:</strong></span></p>
1189 <p><code class="computeroutput">operator=</code>, <code class="computeroutput">assign(size_type, const_reference)</code>, <code class="computeroutput">assign(capacity_type, size_type, const_reference)</code>, <code class="computeroutput">assign(capacity_type, InputIterator, InputIterator)</code> </p>
1192 <div class="variablelist"><table border="0" class="variablelist compact">
1194 <col align="left" valign="top">
1199 <td><p><span class="term">Parameters:</span></p></td>
1200 <td><div class="variablelist"><table border="0" class="variablelist compact">
1202 <col align="left" valign="top">
1207 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
1208 <td><p>The beginning of the range to be copied. </p></td>
1211 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
1212 <td><p>The end of the range to be copied. </p></td>
1218 <td><p><span class="term">Requires:</span></p></td>
1219 <td><p>Valid range <code class="computeroutput">[first, last)</code>.<br>
1220 <code class="computeroutput">first</code> and <code class="computeroutput">last</code> have to meet the requirements of <a href="http://www.sgi.com/tech/stl/InputIterator.html" target="_top">InputIterator</a>. </p></td>
1223 <td><p><span class="term">Postconditions:</span></p></td>
1224 <td><p><code class="computeroutput">capacity().capacity() == std::distance(first, last) && capacity().min_capacity() == 0 && size() == std::distance(first, last) && (*this)[0]== *first && (*this)[1] == *(first + 1) && ... && (*this)[std::distance(first, last) - 1] == *(last - 1)</code><br>
1226 The amount of allocated memory in the internal buffer is <code class="computeroutput">std::distance(first, last)</code>. </p></td>
1229 <td><p><span class="term">Throws:</span></p></td>
1230 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept and <code class="computeroutput">InputIterator</code> is a move iterator. </td>
1235 <li class="listitem">
1236 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
1237 <span class="keyword">void</span> <a name="idp31693824-bb"></a><span class="identifier">assign</span><span class="special">(</span><span class="identifier">capacity_type</span> capacity_ctrl<span class="special">,</span> <span class="identifier">InputIterator</span> first<span class="special">,</span>
1238 <span class="identifier">InputIterator</span> last<span class="special">)</span><span class="special">;</span></pre>Assign a copy of the range into the space optimized circular buffer specifying the capacity. <p>The capacity of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be set to the specified value and the content of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> will be removed and replaced with copies of elements from the specified range.
1243 <p><b>Exception Safety. </b>Basic. </p>
1246 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1249 <p><b>Complexity. </b>Linear (in <code class="computeroutput">std::distance(first, last)</code>; in <code class="computeroutput">min[capacity_ctrl.capacity(), std::distance(first, last)]</code> if the <code class="computeroutput">InputIterator</code> is a <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html" target="_top">RandomAccessIterator</a>). </p>
1252 <p><span class="bold"><strong>See Also:</strong></span></p>
1253 <p><code class="computeroutput">operator=</code>, <code class="computeroutput">assign(size_type, const_reference)</code>, <code class="computeroutput">assign(capacity_type, size_type, const_reference)</code>, <code class="computeroutput">assign(InputIterator, InputIterator)</code> </p>
1256 <div class="variablelist"><table border="0" class="variablelist compact">
1258 <col align="left" valign="top">
1263 <td><p><span class="term">Parameters:</span></p></td>
1264 <td><div class="variablelist"><table border="0" class="variablelist compact">
1266 <col align="left" valign="top">
1271 <td><p><span class="term"><code class="computeroutput">capacity_ctrl</code></span></p></td>
1272 <td><p>The new capacity controller. </p></td>
1275 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
1276 <td><p>The beginning of the range to be copied. </p></td>
1279 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
1280 <td><p>The end of the range to be copied. </p></td>
1286 <td><p><span class="term">Requires:</span></p></td>
1287 <td><p>Valid range <code class="computeroutput">[first, last)</code>.<br>
1288 <code class="computeroutput">first</code> and <code class="computeroutput">last</code> have to meet the requirements of <a href="http://www.sgi.com/tech/stl/InputIterator.html" target="_top">InputIterator</a>. </p></td>
1291 <td><p><span class="term">Postconditions:</span></p></td>
1292 <td><p><code class="computeroutput">capacity() == capacity_ctrl && size() <= std::distance(first, last) && (*this)[0]== *(last - capacity) && (*this)[1] == *(last - capacity + 1) && ... && (*this)[capacity - 1] == *(last - 1)</code><br>
1294 If the number of items to be copied from the range <code class="computeroutput">[first, last)</code> is greater than the specified <code class="computeroutput">capacity</code> then only elements from the range <code class="computeroutput">[last - capacity, last)</code> will be copied.<br>
1296 The amount of allocated memory in the internal buffer is <code class="computeroutput">max[std::distance(first, last), capacity_ctrl.min_capacity()]</code>. </p></td>
1299 <td><p><span class="term">Throws:</span></p></td>
1300 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept and <code class="computeroutput">InputIterator</code> is a move iterator. </td>
1305 <li class="listitem">
1306 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31719696-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span> <span class="special">></span> <span class="special">&</span> cb<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Swap the contents of two space-optimized circular-buffers. <p>
1310 <p><b>Exception Safety. </b>No-throw. </p>
1313 <p><b>Iterator Invalidation. </b>Invalidates all iterators of both <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> containers. (On the other hand the iterators still point to the same elements but within another container. If you want to rely on this feature you have to turn the __debug_support off by defining macro BOOST_CB_DISABLE_DEBUG, otherwise an assertion will report an error if such invalidated iterator is used.) </p>
1316 <p><b>Complexity. </b>Constant (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1319 <p><span class="bold"><strong>See Also:</strong></span></p>
1320 <p><code class="computeroutput">swap(circular_buffer<T, Alloc>&, circular_buffer<T, Alloc>&)</code>, <code class="computeroutput">swap(circular_buffer_space_optimized<T, Alloc>&, circular_buffer_space_optimized<T, Alloc>&)</code> </p>
1323 <div class="variablelist"><table border="0" class="variablelist compact">
1325 <col align="left" valign="top">
1330 <td><p><span class="term">Parameters:</span></p></td>
1331 <td><div class="variablelist"><table border="0" class="variablelist compact">
1333 <col align="left" valign="top">
1337 <td><p><span class="term"><code class="computeroutput">cb</code></span></p></td>
1338 <td><p>The <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> whose content will be swapped. </p></td>
1343 <td><p><span class="term">Postconditions:</span></p></td>
1344 <td><p><code class="computeroutput">this</code> contains elements of <code class="computeroutput">cb</code> and vice versa; the capacity and the amount of allocated memory in the internal buffer of <code class="computeroutput">this</code> equal to the capacity and the amount of allocated memory of <code class="computeroutput">cb</code> and vice versa. </p></td>
1347 <td><p><span class="term">Throws:</span></p></td>
1353 <li class="listitem">
1354 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31733424-bb"></a><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert a new element at the end of the space optimized circular buffer. <p>
1358 <p><b>Exception Safety. </b>Basic. </p>
1361 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1364 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1367 <p><span class="bold"><strong>See Also:</strong></span></p>
1368 <p><code class="computeroutput">push_front(const_reference)</code>, <code class="computeroutput">pop_back()</code>, <code class="computeroutput">pop_front()</code> </p>
1371 <div class="variablelist"><table border="0" class="variablelist compact">
1373 <col align="left" valign="top">
1378 <td><p><span class="term">Parameters:</span></p></td>
1379 <td><div class="variablelist"><table border="0" class="variablelist compact">
1381 <col align="left" valign="top">
1385 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1386 <td><p>The element to be inserted. </p></td>
1391 <td><p><span class="term">Postconditions:</span></p></td>
1392 <td><p>if <code class="computeroutput">capacity().capacity() > 0</code> then <code class="computeroutput">back() == item</code><br>
1393 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the first element will be removed. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1395 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1398 <td><p><span class="term">Throws:</span></p></td>
1399 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
1404 <li class="listitem">
1405 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31748496-bb"></a><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">rvalue_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert a new element at the end of the space optimized circular buffer. <p>
1409 <p><b>Exception Safety. </b>Basic. </p>
1412 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1415 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1418 <p><span class="bold"><strong>See Also:</strong></span></p>
1419 <p><code class="computeroutput">push_front(const_reference)</code>, <code class="computeroutput">pop_back()</code>, <code class="computeroutput">pop_front()</code> </p>
1422 <div class="variablelist"><table border="0" class="variablelist compact">
1424 <col align="left" valign="top">
1429 <td><p><span class="term">Parameters:</span></p></td>
1430 <td><div class="variablelist"><table border="0" class="variablelist compact">
1432 <col align="left" valign="top">
1436 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1437 <td><p>The element to be inserted. </p></td>
1442 <td><p><span class="term">Postconditions:</span></p></td>
1443 <td><p>if <code class="computeroutput">capacity().capacity() > 0</code> then <code class="computeroutput">back() == item</code><br>
1444 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the first element will be removed. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1446 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1449 <td><p><span class="term">Throws:</span></p></td>
1450 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). </td>
1455 <li class="listitem">
1456 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31763104-bb"></a><span class="identifier">push_back</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Insert a new element at the end of the space optimized circular buffer. <p>
1459 <p><b>Exception Safety. </b>Basic. </p>
1462 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1465 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1468 <p><span class="bold"><strong>See Also:</strong></span></p>
1469 <p><code class="computeroutput">push_front(const_reference)</code>, <code class="computeroutput">pop_back()</code>, <code class="computeroutput">pop_front()</code> </p>
1472 <div class="variablelist"><table border="0" class="variablelist compact">
1474 <col align="left" valign="top">
1479 <td><p><span class="term">Postconditions:</span></p></td>
1480 <td><p>if <code class="computeroutput">capacity().capacity() > 0</code> then <code class="computeroutput">back() == item</code><br>
1481 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the first element will be removed. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1483 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1486 <td><p><span class="term">Throws:</span></p></td>
1487 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T()</code> throws. Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
1492 <li class="listitem">
1493 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31777952-bb"></a><span class="identifier">push_front</span><span class="special">(</span><span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert a new element at the beginning of the space optimized circular buffer. <p>
1497 <p><b>Exception Safety. </b>Basic. </p>
1500 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1503 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1506 <p><span class="bold"><strong>See Also:</strong></span></p>
1507 <p><code class="computeroutput">push_back(const_reference)</code>, <code class="computeroutput">pop_back()</code>, <code class="computeroutput">pop_front()</code> </p>
1510 <div class="variablelist"><table border="0" class="variablelist compact">
1512 <col align="left" valign="top">
1517 <td><p><span class="term">Parameters:</span></p></td>
1518 <td><div class="variablelist"><table border="0" class="variablelist compact">
1520 <col align="left" valign="top">
1524 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1525 <td><p>The element to be inserted. </p></td>
1530 <td><p><span class="term">Postconditions:</span></p></td>
1531 <td><p>if <code class="computeroutput">capacity().capacity() > 0</code> then <code class="computeroutput">front() == item</code><br>
1532 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the last element will be removed. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1534 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1537 <td><p><span class="term">Throws:</span></p></td>
1538 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. </td>
1543 <li class="listitem">
1544 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31793024-bb"></a><span class="identifier">push_front</span><span class="special">(</span><span class="identifier">rvalue_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert a new element at the beginning of the space optimized circular buffer. <p>
1548 <p><b>Exception Safety. </b>Basic. </p>
1551 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1554 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1557 <p><span class="bold"><strong>See Also:</strong></span></p>
1558 <p><code class="computeroutput">push_back(const_reference)</code>, <code class="computeroutput">pop_back()</code>, <code class="computeroutput">pop_front()</code> </p>
1561 <div class="variablelist"><table border="0" class="variablelist compact">
1563 <col align="left" valign="top">
1568 <td><p><span class="term">Parameters:</span></p></td>
1569 <td><div class="variablelist"><table border="0" class="variablelist compact">
1571 <col align="left" valign="top">
1575 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1576 <td><p>The element to be inserted. </p></td>
1581 <td><p><span class="term">Postconditions:</span></p></td>
1582 <td><p>if <code class="computeroutput">capacity().capacity() > 0</code> then <code class="computeroutput">front() == item</code><br>
1583 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the last element will be removed. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1585 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1588 <td><p><span class="term">Throws:</span></p></td>
1589 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
1594 <li class="listitem">
1595 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31808544-bb"></a><span class="identifier">push_front</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Insert a new element at the beginning of the space optimized circular buffer. <p>
1598 <p><b>Exception Safety. </b>Basic. </p>
1601 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1604 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1607 <p><span class="bold"><strong>See Also:</strong></span></p>
1608 <p><code class="computeroutput">push_back(const_reference)</code>, <code class="computeroutput">pop_back()</code>, <code class="computeroutput">pop_front()</code> </p>
1611 <div class="variablelist"><table border="0" class="variablelist compact">
1613 <col align="left" valign="top">
1618 <td><p><span class="term">Postconditions:</span></p></td>
1619 <td><p>if <code class="computeroutput">capacity().capacity() > 0</code> then <code class="computeroutput">front() == item</code><br>
1620 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the last element will be removed. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1622 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1625 <td><p><span class="term">Throws:</span></p></td>
1626 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T()</code> throws. Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
1631 <li class="listitem">
1632 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31823392-bb"></a><span class="identifier">pop_back</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Remove the last element from the space optimized circular buffer. <p>
1636 <p><b>Exception Safety. </b>Basic. </p>
1639 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1642 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1645 <p><span class="bold"><strong>See Also:</strong></span></p>
1646 <p><code class="computeroutput">pop_front()</code>, <code class="computeroutput">push_back(const_reference)</code>, <code class="computeroutput">push_front(const_reference)</code> </p>
1649 <div class="variablelist"><table border="0" class="variablelist compact">
1651 <col align="left" valign="top">
1656 <td><p><span class="term">Requires:</span></p></td>
1657 <td><p><code class="computeroutput">!empty()</code> </p></td>
1660 <td><p><span class="term">Postconditions:</span></p></td>
1661 <td><p>The last element is removed from the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code>.<br>
1663 The amount of allocated memory in the internal buffer may be predictively decreased. </p></td>
1666 <td><p><span class="term">Throws:</span></p></td>
1667 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). </td>
1672 <li class="listitem">
1673 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31836048-bb"></a><span class="identifier">pop_front</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Remove the first element from the space optimized circular buffer. <p>
1677 <p><b>Exception Safety. </b>Basic. </p>
1680 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1683 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1686 <p><span class="bold"><strong>See Also:</strong></span></p>
1687 <p><code class="computeroutput">pop_back()</code>, <code class="computeroutput">push_back(const_reference)</code>, <code class="computeroutput">push_front(const_reference)</code> </p>
1690 <div class="variablelist"><table border="0" class="variablelist compact">
1692 <col align="left" valign="top">
1697 <td><p><span class="term">Requires:</span></p></td>
1698 <td><p><code class="computeroutput">!empty()</code> </p></td>
1701 <td><p><span class="term">Postconditions:</span></p></td>
1702 <td><p>The first element is removed from the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code>.<br>
1704 The amount of allocated memory in the internal buffer may be predictively decreased. </p></td>
1707 <td><p><span class="term">Throws:</span></p></td>
1708 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). </td>
1713 <li class="listitem">
1714 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp31848704-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert an element at the specified position. <p>
1720 <p><b>Exception Safety. </b>Basic. </p>
1723 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1726 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1729 <p><span class="bold"><strong>See Also:</strong></span></p>
1730 <p><code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">rinsert(iterator, value_type)</code>, <code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code> </p>
1733 <div class="variablelist"><table border="0" class="variablelist compact">
1735 <col align="left" valign="top">
1740 <td><p><span class="term">Parameters:</span></p></td>
1741 <td><div class="variablelist"><table border="0" class="variablelist compact">
1743 <col align="left" valign="top">
1748 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1749 <td><p>The element to be inserted. </p></td>
1752 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
1753 <td><p>An iterator specifying the position where the <code class="computeroutput">item</code> will be inserted. </p></td>
1759 <td><p><span class="term">Requires:</span></p></td>
1760 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
1763 <td><p><span class="term">Postconditions:</span></p></td>
1764 <td><p>The <code class="computeroutput">item</code> will be inserted at the position <code class="computeroutput">pos</code>.<br>
1765 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the first element will be overwritten. If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full and the <code class="computeroutput">pos</code> points to <code class="computeroutput">begin()</code>, then the <code class="computeroutput">item</code> will not be inserted. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1767 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1770 <td><p><span class="term">Returns:</span></p></td>
1771 <td><p>Iterator to the inserted element or <code class="computeroutput">begin()</code> if the <code class="computeroutput">item</code> is not inserted. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
1774 <td><p><span class="term">Throws:</span></p></td>
1775 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. Whatever <code class="computeroutput">T::operator = (const T&)</code> throws. </td>
1780 <li class="listitem">
1781 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp31872608-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">rvalue_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert an element at the specified position. <p>
1787 <p><b>Exception Safety. </b>Basic. </p>
1790 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1793 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1796 <p><span class="bold"><strong>See Also:</strong></span></p>
1797 <p><code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">rinsert(iterator, value_type)</code>, <code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code> </p>
1800 <div class="variablelist"><table border="0" class="variablelist compact">
1802 <col align="left" valign="top">
1807 <td><p><span class="term">Parameters:</span></p></td>
1808 <td><div class="variablelist"><table border="0" class="variablelist compact">
1810 <col align="left" valign="top">
1815 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1816 <td><p>The element to be inserted. </p></td>
1819 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
1820 <td><p>An iterator specifying the position where the <code class="computeroutput">item</code> will be inserted. </p></td>
1826 <td><p><span class="term">Requires:</span></p></td>
1827 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
1830 <td><p><span class="term">Postconditions:</span></p></td>
1831 <td><p>The <code class="computeroutput">item</code> will be inserted at the position <code class="computeroutput">pos</code>.<br>
1832 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the first element will be overwritten. If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full and the <code class="computeroutput">pos</code> points to <code class="computeroutput">begin()</code>, then the <code class="computeroutput">item</code> will not be inserted. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1834 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1837 <td><p><span class="term">Returns:</span></p></td>
1838 <td><p>Iterator to the inserted element or <code class="computeroutput">begin()</code> if the <code class="computeroutput">item</code> is not inserted. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
1841 <td><p><span class="term">Throws:</span></p></td>
1842 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
1847 <li class="listitem">
1848 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp31896496-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">)</span><span class="special">;</span></pre>Insert an element at the specified position. <p>
1854 <p><b>Exception Safety. </b>Basic. </p>
1857 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1860 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
1863 <p><span class="bold"><strong>See Also:</strong></span></p>
1864 <p><code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">rinsert(iterator, value_type)</code>, <code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code> </p>
1867 <div class="variablelist"><table border="0" class="variablelist compact">
1869 <col align="left" valign="top">
1874 <td><p><span class="term">Parameters:</span></p></td>
1875 <td><div class="variablelist"><table border="0" class="variablelist compact">
1877 <col align="left" valign="top">
1881 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
1882 <td><p>An iterator specifying the position where the <code class="computeroutput">item</code> will be inserted. </p></td>
1887 <td><p><span class="term">Requires:</span></p></td>
1888 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
1891 <td><p><span class="term">Postconditions:</span></p></td>
1892 <td><p>The <code class="computeroutput">item</code> will be inserted at the position <code class="computeroutput">pos</code>.<br>
1893 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the first element will be overwritten. If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full and the <code class="computeroutput">pos</code> points to <code class="computeroutput">begin()</code>, then the <code class="computeroutput">item</code> will not be inserted. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
1895 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1898 <td><p><span class="term">Returns:</span></p></td>
1899 <td><p>Iterator to the inserted element or <code class="computeroutput">begin()</code> if the <code class="computeroutput">item</code> is not inserted. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
1902 <td><p><span class="term">Throws:</span></p></td>
1903 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T()</code> throws. Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
1908 <li class="listitem">
1909 <pre class="literallayout"><span class="keyword">void</span> <a name="idp31919712-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">size_type</span> n<span class="special">,</span> <span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert <code class="computeroutput">n</code> copies of the <code class="computeroutput">item</code> at the specified position. <p>
1914 <p><b>Exception Safety. </b>Basic. </p>
1917 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
1920 <p><b>Complexity. </b>Linear (in <code class="computeroutput">min[capacity().capacity(), size() + n]</code>). </p>
1923 <p><b>Example. </b>Consider a <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<br>
1925 <code class="computeroutput">|1|2|3|4| | |</code><br>
1926 <code class="computeroutput">p ___^</code><br>
1928 After inserting 5 elements at the position <code class="computeroutput">p</code>:<br>
1930 <code class="computeroutput">insert(p, (size_t)5, 0);</code><br>
1932 actually only 4 elements get inserted and elements <code class="computeroutput">1</code> and <code class="computeroutput">2</code> are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:<br>
1934 <code class="computeroutput">|0|0|0|0|3|4|</code><br>
1936 For comparison if the capacity would not be preserved the internal buffer would then result in <code class="computeroutput">|1|2|0|0|0|0|0|3|4|</code>. </p>
1939 <p><span class="bold"><strong>See Also:</strong></span></p>
1940 <p><code class="computeroutput">insert(iterator, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">rinsert(iterator, value_type)</code>, <code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code> </p>
1943 <div class="variablelist"><table border="0" class="variablelist compact">
1945 <col align="left" valign="top">
1950 <td><p><span class="term">Parameters:</span></p></td>
1951 <td><div class="variablelist"><table border="0" class="variablelist compact">
1953 <col align="left" valign="top">
1958 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
1959 <td><p>The element whose copies will be inserted. </p></td>
1962 <td><p><span class="term"><code class="computeroutput">n</code></span></p></td>
1963 <td><p>The number of <code class="computeroutput">item</code>s the to be inserted. </p></td>
1966 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
1967 <td><p>An iterator specifying the position where the <code class="computeroutput">item</code>s will be inserted. </p></td>
1973 <td><p><span class="term">Requires:</span></p></td>
1974 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
1977 <td><p><span class="term">Postconditions:</span></p></td>
1978 <td><p>The number of <code class="computeroutput">min[n, (pos - begin()) + reserve()]</code> elements will be inserted at the position <code class="computeroutput">pos</code>.<br>
1979 The number of <code class="computeroutput">min[pos - begin(), max[0, n - reserve()]]</code> elements will be overwritten at the beginning of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code>.<br>
1980 (See <span class="emphasis"><em>Example</em></span> for the explanation.)<br>
1982 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
1985 <td><p><span class="term">Throws:</span></p></td>
1986 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. Whatever <code class="computeroutput">T::operator = (const T&)</code> throws. </td>
1991 <li class="listitem">
1992 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
1993 <span class="keyword">void</span> <a name="idp31951152-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">InputIterator</span> first<span class="special">,</span> <span class="identifier">InputIterator</span> last<span class="special">)</span><span class="special">;</span></pre>Insert the range <code class="computeroutput">[first, last)</code> at the specified position. <p>
1998 <p><b>Exception Safety. </b>Basic. </p>
2001 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2004 <p><b>Complexity. </b>Linear (in <code class="computeroutput">[size() + std::distance(first, last)]</code>; in <code class="computeroutput">min[capacity().capacity(), size() + std::distance(first, last)]</code> if the <code class="computeroutput">InputIterator</code> is a <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html" target="_top">RandomAccessIterator</a>). </p>
2007 <p><b>Example. </b>Consider a <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<br>
2009 <code class="computeroutput">|1|2|3|4| | |</code><br>
2010 <code class="computeroutput">p ___^</code><br>
2012 After inserting a range of elements at the position <code class="computeroutput">p</code>:<br>
2014 <code class="computeroutput">int array[] = { 5, 6, 7, 8, 9 };</code><br>
2015 <code class="computeroutput">insert(p, array, array + 5);</code><br>
2017 actually only elements <code class="computeroutput">6</code>, <code class="computeroutput">7</code>, <code class="computeroutput">8</code> and <code class="computeroutput">9</code> from the specified range get inserted and elements <code class="computeroutput">1</code> and <code class="computeroutput">2</code> are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:<br>
2019 <code class="computeroutput">|6|7|8|9|3|4|</code><br>
2021 For comparison if the capacity would not be preserved the internal buffer would then result in <code class="computeroutput">|1|2|5|6|7|8|9|3|4|</code>. </p>
2024 <p><span class="bold"><strong>See Also:</strong></span></p>
2025 <p><code class="computeroutput">insert(iterator, value_type)</code>, <code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, value_type)</code>, <code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code> </p>
2028 <div class="variablelist"><table border="0" class="variablelist compact">
2030 <col align="left" valign="top">
2035 <td><p><span class="term">Parameters:</span></p></td>
2036 <td><div class="variablelist"><table border="0" class="variablelist compact">
2038 <col align="left" valign="top">
2043 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
2044 <td><p>The beginning of the range to be inserted. </p></td>
2047 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
2048 <td><p>The end of the range to be inserted. </p></td>
2051 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2052 <td><p>An iterator specifying the position where the range will be inserted. </p></td>
2058 <td><p><span class="term">Requires:</span></p></td>
2059 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end.<br>
2060 Valid range <code class="computeroutput">[first, last)</code> where <code class="computeroutput">first</code> and <code class="computeroutput">last</code> meet the requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html" target="_top">InputIterator</a>. </p></td>
2063 <td><p><span class="term">Postconditions:</span></p></td>
2064 <td><p>Elements from the range <code class="computeroutput">[first + max[0, distance(first, last) - (pos - begin()) - reserve()], last)</code> will be inserted at the position <code class="computeroutput">pos</code>.<br>
2065 The number of <code class="computeroutput">min[pos - begin(), max[0, distance(first, last) - reserve()]]</code> elements will be overwritten at the beginning of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code>.<br>
2066 (See <span class="emphasis"><em>Example</em></span> for the explanation.)<br>
2068 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
2071 <td><p><span class="term">Throws:</span></p></td>
2072 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
2077 <li class="listitem">
2078 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp31988656-bb"></a><span class="identifier">rinsert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert an element before the specified position. <p>
2084 <p><b>Exception Safety. </b>Basic. </p>
2087 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2090 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2093 <p><span class="bold"><strong>See Also:</strong></span></p>
2094 <p><code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">insert(iterator, value_type)</code>, <code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code> </p>
2097 <div class="variablelist"><table border="0" class="variablelist compact">
2099 <col align="left" valign="top">
2104 <td><p><span class="term">Parameters:</span></p></td>
2105 <td><div class="variablelist"><table border="0" class="variablelist compact">
2107 <col align="left" valign="top">
2112 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
2113 <td><p>The element to be inserted. </p></td>
2116 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2117 <td><p>An iterator specifying the position before which the <code class="computeroutput">item</code> will be inserted. </p></td>
2123 <td><p><span class="term">Requires:</span></p></td>
2124 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
2127 <td><p><span class="term">Postconditions:</span></p></td>
2128 <td><p>The <code class="computeroutput">item</code> will be inserted before the position <code class="computeroutput">pos</code>.<br>
2129 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the last element will be overwritten. If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full and the <code class="computeroutput">pos</code> points to <code class="computeroutput">end()</code>, then the <code class="computeroutput">item</code> will not be inserted. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
2131 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
2134 <td><p><span class="term">Returns:</span></p></td>
2135 <td><p>Iterator to the inserted element or <code class="computeroutput">end()</code> if the <code class="computeroutput">item</code> is not inserted. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
2138 <td><p><span class="term">Throws:</span></p></td>
2139 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. Whatever <code class="computeroutput">T::operator = (const T&)</code> throws. </td>
2144 <li class="listitem">
2145 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp32012544-bb"></a><span class="identifier">rinsert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">rvalue_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert an element before the specified position. <p>
2151 <p><b>Exception Safety. </b>Basic. </p>
2154 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2157 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2160 <p><span class="bold"><strong>See Also:</strong></span></p>
2161 <p><code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">insert(iterator, value_type)</code>, <code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code> </p>
2164 <div class="variablelist"><table border="0" class="variablelist compact">
2166 <col align="left" valign="top">
2171 <td><p><span class="term">Parameters:</span></p></td>
2172 <td><div class="variablelist"><table border="0" class="variablelist compact">
2174 <col align="left" valign="top">
2179 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
2180 <td><p>The element to be inserted. </p></td>
2183 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2184 <td><p>An iterator specifying the position before which the <code class="computeroutput">item</code> will be inserted. </p></td>
2190 <td><p><span class="term">Requires:</span></p></td>
2191 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
2194 <td><p><span class="term">Postconditions:</span></p></td>
2195 <td><p>The <code class="computeroutput">item</code> will be inserted before the position <code class="computeroutput">pos</code>.<br>
2196 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the last element will be overwritten. If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full and the <code class="computeroutput">pos</code> points to <code class="computeroutput">end()</code>, then the <code class="computeroutput">item</code> will not be inserted. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
2198 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
2201 <td><p><span class="term">Returns:</span></p></td>
2202 <td><p>Iterator to the inserted element or <code class="computeroutput">end()</code> if the <code class="computeroutput">item</code> is not inserted. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
2205 <td><p><span class="term">Throws:</span></p></td>
2206 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
2211 <li class="listitem">
2212 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp32036416-bb"></a><span class="identifier">rinsert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">)</span><span class="special">;</span></pre>Insert an element before the specified position. <p>
2218 <p><b>Exception Safety. </b>Basic. </p>
2221 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2224 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2227 <p><span class="bold"><strong>See Also:</strong></span></p>
2228 <p><code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">insert(iterator, value_type)</code>, <code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code> </p>
2231 <div class="variablelist"><table border="0" class="variablelist compact">
2233 <col align="left" valign="top">
2238 <td><p><span class="term">Parameters:</span></p></td>
2239 <td><div class="variablelist"><table border="0" class="variablelist compact">
2241 <col align="left" valign="top">
2245 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2246 <td><p>An iterator specifying the position before which the <code class="computeroutput">item</code> will be inserted. </p></td>
2251 <td><p><span class="term">Requires:</span></p></td>
2252 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
2255 <td><p><span class="term">Postconditions:</span></p></td>
2256 <td><p>The <code class="computeroutput">item</code> will be inserted before the position <code class="computeroutput">pos</code>.<br>
2257 If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full, the last element will be overwritten. If the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> is full and the <code class="computeroutput">pos</code> points to <code class="computeroutput">end()</code>, then the <code class="computeroutput">item</code> will not be inserted. If the capacity is <code class="computeroutput">0</code>, nothing will be inserted.<br>
2259 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
2262 <td><p><span class="term">Returns:</span></p></td>
2263 <td><p>Iterator to the inserted element or <code class="computeroutput">end()</code> if the <code class="computeroutput">item</code> is not inserted. (See the <span class="emphasis"><em>Effect</em></span>.) </p></td>
2266 <td><p><span class="term">Throws:</span></p></td>
2267 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T()</code> throws. Whatever <code class="computeroutput">T::T(const T&)</code> throws or nothing if <code class="computeroutput">T::T(T&&)</code> is noexcept. </td>
2272 <li class="listitem">
2273 <pre class="literallayout"><span class="keyword">void</span> <a name="idp32059616-bb"></a><span class="identifier">rinsert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">size_type</span> n<span class="special">,</span> <span class="identifier">param_value_type</span> item<span class="special">)</span><span class="special">;</span></pre>Insert <code class="computeroutput">n</code> copies of the <code class="computeroutput">item</code> before the specified position. <p>
2278 <p><b>Exception Safety. </b>Basic. </p>
2281 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2284 <p><b>Complexity. </b>Linear (in <code class="computeroutput">min[capacity().capacity(), size() + n]</code>). </p>
2287 <p><b>Example. </b>Consider a <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<br>
2289 <code class="computeroutput">|1|2|3|4| | |</code><br>
2290 <code class="computeroutput">p ___^</code><br>
2292 After inserting 5 elements before the position <code class="computeroutput">p</code>:<br>
2294 <code class="computeroutput">rinsert(p, (size_t)5, 0);</code><br>
2296 actually only 4 elements get inserted and elements <code class="computeroutput">3</code> and <code class="computeroutput">4</code> are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:<br>
2298 <code class="computeroutput">|1|2|0|0|0|0|</code><br>
2300 For comparison if the capacity would not be preserved the internal buffer would then result in <code class="computeroutput">|1|2|0|0|0|0|0|3|4|</code>. </p>
2303 <p><span class="bold"><strong>See Also:</strong></span></p>
2304 <p><code class="computeroutput">rinsert(iterator, value_type)</code>, <code class="computeroutput">rinsert(iterator, InputIterator, InputIterator)</code>, <code class="computeroutput">insert(iterator, value_type)</code>, <code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code> </p>
2307 <div class="variablelist"><table border="0" class="variablelist compact">
2309 <col align="left" valign="top">
2314 <td><p><span class="term">Parameters:</span></p></td>
2315 <td><div class="variablelist"><table border="0" class="variablelist compact">
2317 <col align="left" valign="top">
2322 <td><p><span class="term"><code class="computeroutput">item</code></span></p></td>
2323 <td><p>The element whose copies will be inserted. </p></td>
2326 <td><p><span class="term"><code class="computeroutput">n</code></span></p></td>
2327 <td><p>The number of <code class="computeroutput">item</code>s the to be inserted. </p></td>
2330 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2331 <td><p>An iterator specifying the position where the <code class="computeroutput">item</code>s will be inserted. </p></td>
2337 <td><p><span class="term">Requires:</span></p></td>
2338 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end. </p></td>
2341 <td><p><span class="term">Postconditions:</span></p></td>
2342 <td><p>The number of <code class="computeroutput">min[n, (end() - pos) + reserve()]</code> elements will be inserted before the position <code class="computeroutput">pos</code>.<br>
2343 The number of <code class="computeroutput">min[end() - pos, max[0, n - reserve()]]</code> elements will be overwritten at the end of the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code>.<br>
2344 (See <span class="emphasis"><em>Example</em></span> for the explanation.)<br>
2346 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
2349 <td><p><span class="term">Throws:</span></p></td>
2350 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. Whatever <code class="computeroutput">T::operator = (const T&)</code> throws. </td>
2355 <li class="listitem">
2356 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
2357 <span class="keyword">void</span> <a name="idp32091024-bb"></a><span class="identifier">rinsert</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">,</span> <span class="identifier">InputIterator</span> first<span class="special">,</span> <span class="identifier">InputIterator</span> last<span class="special">)</span><span class="special">;</span></pre>Insert the range <code class="computeroutput">[first, last)</code> before the specified position. <p>
2362 <p><b>Exception Safety. </b>Basic. </p>
2365 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2368 <p><b>Complexity. </b>Linear (in <code class="computeroutput">[size() + std::distance(first, last)]</code>; in <code class="computeroutput">min[capacity().capacity(), size() + std::distance(first, last)]</code> if the <code class="computeroutput">InputIterator</code> is a <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html" target="_top">RandomAccessIterator</a>). </p>
2371 <p><b>Example. </b>Consider a <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<br>
2373 <code class="computeroutput">|1|2|3|4| | |</code><br>
2374 <code class="computeroutput">p ___^</code><br>
2376 After inserting a range of elements before the position <code class="computeroutput">p</code>:<br>
2378 <code class="computeroutput">int array[] = { 5, 6, 7, 8, 9 };</code><br>
2379 <code class="computeroutput">insert(p, array, array + 5);</code><br>
2381 actually only elements <code class="computeroutput">5</code>, <code class="computeroutput">6</code>, <code class="computeroutput">7</code> and <code class="computeroutput">8</code> from the specified range get inserted and elements <code class="computeroutput">3</code> and <code class="computeroutput">4</code> are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:<br>
2383 <code class="computeroutput">|1|2|5|6|7|8|</code><br>
2385 For comparison if the capacity would not be preserved the internal buffer would then result in <code class="computeroutput">|1|2|5|6|7|8|9|3|4|</code>. </p>
2388 <p><span class="bold"><strong>See Also:</strong></span></p>
2389 <p><code class="computeroutput">rinsert(iterator, value_type)</code>, <code class="computeroutput">rinsert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, value_type)</code>, <code class="computeroutput">insert(iterator, size_type, value_type)</code>, <code class="computeroutput">insert(iterator, InputIterator, InputIterator)</code> </p>
2392 <div class="variablelist"><table border="0" class="variablelist compact">
2394 <col align="left" valign="top">
2399 <td><p><span class="term">Parameters:</span></p></td>
2400 <td><div class="variablelist"><table border="0" class="variablelist compact">
2402 <col align="left" valign="top">
2407 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
2408 <td><p>The beginning of the range to be inserted. </p></td>
2411 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
2412 <td><p>The end of the range to be inserted. </p></td>
2415 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2416 <td><p>An iterator specifying the position where the range will be inserted. </p></td>
2422 <td><p><span class="term">Requires:</span></p></td>
2423 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> or its end.<br>
2424 Valid range <code class="computeroutput">[first, last)</code> where <code class="computeroutput">first</code> and <code class="computeroutput">last</code> meet the requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html" target="_top">InputIterator</a>. </p></td>
2427 <td><p><span class="term">Postconditions:</span></p></td>
2428 <td><p>Elements from the range <code class="computeroutput">[first, last - max[0, distance(first, last) - (end() - pos) - reserve()])</code> will be inserted before the position <code class="computeroutput">pos</code>.<br>
2429 The number of <code class="computeroutput">min[end() - pos, max[0, distance(first, last) - reserve()]]</code> elements will be overwritten at the end of the <code class="computeroutput"><a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a></code>.<br>
2430 (See <span class="emphasis"><em>Example</em></span> for the explanation.)<br>
2432 The amount of allocated memory in the internal buffer may be predictively increased. </p></td>
2435 <td><p><span class="term">Throws:</span></p></td>
2436 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::T(const T&)</code> throws. Whatever <code class="computeroutput">T::operator = (const T&)</code> throws. </td>
2441 <li class="listitem">
2442 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp32128528-bb"></a><span class="identifier">erase</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">)</span><span class="special">;</span></pre>Remove an element at the specified position. <p>
2448 <p><b>Exception Safety. </b>Basic. </p>
2451 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2454 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2457 <p><span class="bold"><strong>See Also:</strong></span></p>
2458 <p><code class="computeroutput">erase(iterator, iterator)</code>, <code class="computeroutput">rerase(iterator)</code>, <code class="computeroutput">rerase(iterator, iterator)</code>, <code class="computeroutput">clear()</code> </p>
2461 <div class="variablelist"><table border="0" class="variablelist compact">
2463 <col align="left" valign="top">
2468 <td><p><span class="term">Parameters:</span></p></td>
2469 <td><div class="variablelist"><table border="0" class="variablelist compact">
2471 <col align="left" valign="top">
2475 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2476 <td><p>An iterator pointing at the element to be removed. </p></td>
2481 <td><p><span class="term">Requires:</span></p></td>
2482 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> (but not an <code class="computeroutput">end()</code>). </p></td>
2485 <td><p><span class="term">Postconditions:</span></p></td>
2486 <td><p>The element at the position <code class="computeroutput">pos</code> is removed.<br>
2488 The amount of allocated memory in the internal buffer may be predictively decreased. </p></td>
2491 <td><p><span class="term">Returns:</span></p></td>
2492 <td><p>Iterator to the first element remaining beyond the removed element or <code class="computeroutput">end()</code> if no such element exists. </p></td>
2495 <td><p><span class="term">Throws:</span></p></td>
2496 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::operator = (const T&)</code> throws or nothing if <code class="computeroutput">T::operator = (T&&)</code> is noexcept. </td>
2501 <li class="listitem">
2502 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp32145520-bb"></a><span class="identifier">erase</span><span class="special">(</span><span class="identifier">iterator</span> first<span class="special">,</span> <span class="identifier">iterator</span> last<span class="special">)</span><span class="special">;</span></pre>Erase the range <code class="computeroutput">[first, last)</code>. <p>
2508 <p><b>Exception Safety. </b>Basic. </p>
2511 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2514 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2517 <p><span class="bold"><strong>See Also:</strong></span></p>
2518 <p><code class="computeroutput">erase(iterator)</code>, <code class="computeroutput">rerase(iterator)</code>, <code class="computeroutput">rerase(iterator, iterator)</code>, <code class="computeroutput">clear()</code> </p>
2521 <div class="variablelist"><table border="0" class="variablelist compact">
2523 <col align="left" valign="top">
2528 <td><p><span class="term">Parameters:</span></p></td>
2529 <td><div class="variablelist"><table border="0" class="variablelist compact">
2531 <col align="left" valign="top">
2536 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
2537 <td><p>The beginning of the range to be removed. </p></td>
2540 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
2541 <td><p>The end of the range to be removed. </p></td>
2547 <td><p><span class="term">Requires:</span></p></td>
2548 <td><p>Valid range <code class="computeroutput">[first, last)</code>. </p></td>
2551 <td><p><span class="term">Postconditions:</span></p></td>
2552 <td><p>The elements from the range <code class="computeroutput">[first, last)</code> are removed. (If <code class="computeroutput">first == last</code> nothing is removed.)<br>
2554 The amount of allocated memory in the internal buffer may be predictively decreased. </p></td>
2557 <td><p><span class="term">Returns:</span></p></td>
2558 <td><p>Iterator to the first element remaining beyond the removed elements or <code class="computeroutput">end()</code> if no such element exists. </p></td>
2561 <td><p><span class="term">Throws:</span></p></td>
2562 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::operator = (const T&)</code> throws or nothing if <code class="computeroutput">T::operator = (T&&)</code> is noexcept. </td>
2567 <li class="listitem">
2568 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp32163296-bb"></a><span class="identifier">rerase</span><span class="special">(</span><span class="identifier">iterator</span> pos<span class="special">)</span><span class="special">;</span></pre>Remove an element at the specified position. <p>
2574 <p><b>Exception Safety. </b>Basic. </p>
2577 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2580 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2583 <div class="note"><table border="0" summary="Note">
2585 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/src/images/note.png"></td>
2586 <th align="left">Note</th>
2588 <tr><td align="left" valign="top"><p>Basically there is no difference between <code class="computeroutput">erase(iterator)</code> and this method. It is implemented only for consistency with the base <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a></code></code>. </p></td></tr>
2592 <p><span class="bold"><strong>See Also:</strong></span></p>
2593 <p><code class="computeroutput">erase(iterator)</code>, <code class="computeroutput">erase(iterator, iterator)</code>, <code class="computeroutput">rerase(iterator, iterator)</code>, <code class="computeroutput">clear()</code> </p>
2596 <div class="variablelist"><table border="0" class="variablelist compact">
2598 <col align="left" valign="top">
2603 <td><p><span class="term">Parameters:</span></p></td>
2604 <td><div class="variablelist"><table border="0" class="variablelist compact">
2606 <col align="left" valign="top">
2610 <td><p><span class="term"><code class="computeroutput">pos</code></span></p></td>
2611 <td><p>An iterator pointing at the element to be removed. </p></td>
2616 <td><p><span class="term">Requires:</span></p></td>
2617 <td><p><code class="computeroutput">pos</code> is a valid iterator pointing to the <code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code> (but not an <code class="computeroutput">end()</code>).<br>
2619 The amount of allocated memory in the internal buffer may be predictively decreased. </p></td>
2622 <td><p><span class="term">Postconditions:</span></p></td>
2623 <td><p>The element at the position <code class="computeroutput">pos</code> is removed. </p></td>
2626 <td><p><span class="term">Returns:</span></p></td>
2627 <td><p>Iterator to the first element remaining in front of the removed element or <code class="computeroutput">begin()</code> if no such element exists. </p></td>
2630 <td><p><span class="term">Throws:</span></p></td>
2631 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::operator = (const T&)</code> throws or nothing if <code class="computeroutput">T::operator = (T&&)</code> is noexcept. </td>
2636 <li class="listitem">
2637 <pre class="literallayout"><span class="identifier">iterator</span> <a name="idp32182256-bb"></a><span class="identifier">rerase</span><span class="special">(</span><span class="identifier">iterator</span> first<span class="special">,</span> <span class="identifier">iterator</span> last<span class="special">)</span><span class="special">;</span></pre>Erase the range <code class="computeroutput">[first, last)</code>. <p>
2643 <p><b>Exception Safety. </b>Basic. </p>
2646 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2649 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2652 <div class="note"><table border="0" summary="Note">
2654 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/src/images/note.png"></td>
2655 <th align="left">Note</th>
2657 <tr><td align="left" valign="top"><p>Basically there is no difference between <code class="computeroutput">erase(iterator, iterator)</code> and this method. It is implemented only for consistency with the base <code class="computeroutput"><<code class="computeroutput"><a class="link" href="circular_buffer.html" title="Class template circular_buffer">circular_buffer</a></code></code>. </p></td></tr>
2661 <p><span class="bold"><strong>See Also:</strong></span></p>
2662 <p><code class="computeroutput">erase(iterator)</code>, <code class="computeroutput">erase(iterator, iterator)</code>, <code class="computeroutput">rerase(iterator)</code>, <code class="computeroutput">clear()</code> </p>
2665 <div class="variablelist"><table border="0" class="variablelist compact">
2667 <col align="left" valign="top">
2672 <td><p><span class="term">Parameters:</span></p></td>
2673 <td><div class="variablelist"><table border="0" class="variablelist compact">
2675 <col align="left" valign="top">
2680 <td><p><span class="term"><code class="computeroutput">first</code></span></p></td>
2681 <td><p>The beginning of the range to be removed. </p></td>
2684 <td><p><span class="term"><code class="computeroutput">last</code></span></p></td>
2685 <td><p>The end of the range to be removed. </p></td>
2691 <td><p><span class="term">Requires:</span></p></td>
2692 <td><p>Valid range <code class="computeroutput">[first, last)</code>. </p></td>
2695 <td><p><span class="term">Postconditions:</span></p></td>
2696 <td><p>The elements from the range <code class="computeroutput">[first, last)</code> are removed. (If <code class="computeroutput">first == last</code> nothing is removed.)<br>
2698 The amount of allocated memory in the internal buffer may be predictively decreased. </p></td>
2701 <td><p><span class="term">Returns:</span></p></td>
2702 <td><p>Iterator to the first element remaining in front of the removed elements or <code class="computeroutput">begin()</code> if no such element exists. </p></td>
2705 <td><p><span class="term">Throws:</span></p></td>
2706 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). Whatever <code class="computeroutput">T::operator = (const T&)</code> throws or nothing if <code class="computeroutput">T::operator = (T&&)</code> is noexcept. </td>
2711 <li class="listitem">
2712 <pre class="literallayout"><span class="keyword">void</span> <a name="idp32202176-bb"></a><span class="identifier">clear</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Remove all stored elements from the space optimized circular buffer. <p>
2715 <p><b>Exception Safety. </b>Basic. </p>
2718 <p><b>Iterator Invalidation. </b>Invalidates all iterators pointing to the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code> (except iterators equal to <code class="computeroutput">end()</code>). </p>
2721 <p><b>Complexity. </b>Linear (in the size of the <code class="computeroutput"><code class="computeroutput"><a class="link" href="circular_buffe_idp31480224.html" title="Class template circular_buffer_space_optimized">circular_buffer_space_optimized</a></code></code>). </p>
2724 <p><span class="bold"><strong>See Also:</strong></span></p>
2725 <p><code class="computeroutput">~circular_buffer_space_optimized()</code>, <code class="computeroutput">erase(iterator)</code>, <code class="computeroutput">erase(iterator, iterator)</code>, <code class="computeroutput">rerase(iterator)</code>, <code class="computeroutput">rerase(iterator, iterator)</code> </p>
2728 <div class="variablelist"><table border="0" class="variablelist compact">
2730 <col align="left" valign="top">
2735 <td><p><span class="term">Postconditions:</span></p></td>
2736 <td><p><code class="computeroutput">size() == 0</code><br>
2738 The amount of allocated memory in the internal buffer may be predictively decreased. </p></td>
2741 <td><p><span class="term">Throws:</span></p></td>
2742 <td>An allocation error if memory is exhausted (<code class="computeroutput">std::bad_alloc</code> if the standard allocator is used). </td>
2749 <div class="refsect2">
2750 <a name="idp148016208"></a><h3>
2751 <a name="idp32330288-bb"></a><code class="computeroutput">circular_buffer_space_optimized</code> private member functions</h3>
2752 <div class="orderedlist"><ol class="orderedlist" type="1">
2753 <li class="listitem">
2754 <pre class="literallayout"><span class="keyword">void</span> <a name="idp32330864-bb"></a><span class="identifier">adjust_min_capacity</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Adjust the amount of allocated memory. </li>
2755 <li class="listitem">
2756 <pre class="literallayout"><span class="identifier">size_type</span> <a name="idp32332016-bb"></a><span class="identifier">ensure_reserve</span><span class="special">(</span><span class="identifier">size_type</span> new_capacity<span class="special">,</span> <span class="identifier">size_type</span> buffer_size<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Ensure the reserve for possible growth up. </li>
2757 <li class="listitem">
2758 <pre class="literallayout"><span class="keyword">void</span> <a name="idp32334832-bb"></a><span class="identifier">check_low_capacity</span><span class="special">(</span><span class="identifier">size_type</span> n <span class="special">=</span> <span class="number">1</span><span class="special">)</span><span class="special">;</span></pre>Check for low capacity. </li>
2759 <li class="listitem">
2760 <pre class="literallayout"><span class="keyword">void</span> <a name="idp32336960-bb"></a><span class="identifier">check_high_capacity</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Check for high capacity. </li>
2761 <li class="listitem">
2762 <pre class="literallayout"><span class="keyword">void</span> <a name="idp32338112-bb"></a><span class="identifier">reduce_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized method for reducing the capacity. </li>
2763 <li class="listitem">
2764 <pre class="literallayout"><span class="keyword">void</span> <a name="idp32339968-bb"></a><span class="identifier">reduce_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized method for reducing the capacity. </li>
2765 <li class="listitem">
2766 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> IntegralType<span class="special">></span>
2767 <span class="keyword">void</span> <a name="idp32341824-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span> pos<span class="special">,</span> <span class="identifier">IntegralType</span> n<span class="special">,</span> <span class="identifier">IntegralType</span> item<span class="special">,</span>
2768 <span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized insert method. </li>
2769 <li class="listitem">
2770 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
2771 <span class="keyword">void</span> <a name="idp32346576-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span> pos<span class="special">,</span> <span class="identifier">Iterator</span> first<span class="special">,</span> <span class="identifier">Iterator</span> last<span class="special">,</span>
2772 <span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized insert method. </li>
2773 <li class="listitem">
2774 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> IntegralType<span class="special">></span>
2775 <span class="keyword">void</span> <a name="idp32351328-bb"></a><span class="identifier">rinsert</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span> pos<span class="special">,</span> <span class="identifier">IntegralType</span> n<span class="special">,</span> <span class="identifier">IntegralType</span> item<span class="special">,</span>
2776 <span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized rinsert method. </li>
2777 <li class="listitem">
2778 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
2779 <span class="keyword">void</span> <a name="idp32356080-bb"></a><span class="identifier">rinsert</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">iterator</span> <span class="special">&</span> pos<span class="special">,</span> <span class="identifier">Iterator</span> first<span class="special">,</span> <span class="identifier">Iterator</span> last<span class="special">,</span>
2780 <span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized rinsert method. </li>
2783 <div class="refsect2">
2784 <a name="idp148111840"></a><h3>
2785 <a name="idp32360992-bb"></a><code class="computeroutput">circular_buffer_space_optimized</code> private static functions</h3>
2786 <div class="orderedlist"><ol class="orderedlist" type="1">
2787 <li class="listitem">
2788 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">size_type</span>
2789 <a name="idp32361568-bb"></a><span class="identifier">init_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> capacity_ctrl<span class="special">,</span> <span class="identifier">size_type</span> n<span class="special">)</span><span class="special">;</span></pre>Determine the initial capacity. </li>
2790 <li class="listitem">
2791 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> IntegralType<span class="special">></span>
2792 <span class="keyword">static</span> <span class="identifier">size_type</span>
2793 <a name="idp32364368-bb"></a><span class="identifier">init_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> capacity_ctrl<span class="special">,</span> <span class="identifier">IntegralType</span> n<span class="special">,</span>
2794 <span class="identifier">IntegralType</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">true_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized method for determining the initial capacity. </li>
2795 <li class="listitem">
2796 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
2797 <span class="keyword">static</span> <span class="identifier">size_type</span>
2798 <a name="idp32369424-bb"></a><span class="identifier">init_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> capacity_ctrl<span class="special">,</span> <span class="identifier">Iterator</span> first<span class="special">,</span>
2799 <span class="identifier">Iterator</span> last<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">false_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized method for determining the initial capacity. </li>
2800 <li class="listitem">
2801 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> InputIterator<span class="special">></span>
2802 <span class="keyword">static</span> <span class="identifier">size_type</span>
2803 <a name="idp32374480-bb"></a><span class="identifier">init_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> capacity_ctrl<span class="special">,</span> <span class="identifier">InputIterator</span><span class="special">,</span>
2804 <span class="identifier">InputIterator</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">input_iterator_tag</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized method for determining the initial capacity. </li>
2805 <li class="listitem">
2806 <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> ForwardIterator<span class="special">></span>
2807 <span class="keyword">static</span> <span class="identifier">size_type</span>
2808 <a name="idp32379552-bb"></a><span class="identifier">init_capacity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">capacity_type</span> <span class="special">&</span> capacity_ctrl<span class="special">,</span> <span class="identifier">ForwardIterator</span> first<span class="special">,</span>
2809 <span class="identifier">ForwardIterator</span> last<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward_iterator_tag</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Specialized method for determining the initial capacity. </li>
2814 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
2815 <td align="left"></td>
2816 <td align="right"><div class="copyright-footer">Copyright © 2003-2013 Jan Gaspar<p>
2817 Distributed under the Boost Software License, Version 1.0. (See accompanying
2818 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>)
2823 <div class="spirit-nav">
2824 <a accesskey="p" href="swap_idp31458912.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_circular_buffer_c___reference.html#header.boost.circular_buffer.space_optimized_hpp"><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="../circular_buffer/s14.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>