<?xml version="1.0" standalone="yes"?>
<library-reference id="boost_circular_buffer_c___reference"><title>Boost.Circular_buffer C++ Reference</title><header id="doxygen.boost_circular_buffer_c___reference.circular__buffer_8hpp" name="boost/circular_buffer.hpp">
<para>Includes &lt;<link linkend="doxygen.boost_circular_buffer_c___reference.base_8hpp_source">boost/circular_buffer/base.hpp</link>&gt; </para><macro id="doxygen.boost_circular_buffer_c___reference.circular__buffer_8hpp_1a0b0e6ce96d98bc0cf0ad7fdb36b003ad" name="BOOST_CB_ENABLE_DEBUG"><description><para>Debug support control. </para></description></macro>
</header>
<header id="doxygen.boost_circular_buffer_c___reference.base_8hpp" name="boost/circular_buffer/base.hpp">
<namespace name="boost">
<class id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer" name="circular_buffer"><template>
      <template-type-parameter name="T"><purpose><para>The type of the elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para></purpose></template-type-parameter>
      <template-type-parameter name="Alloc"><purpose><para>The allocator type used for all internal memory management. </para></purpose></template-type-parameter>
    </template><inherit access="private">empty_value&lt; Alloc &gt;</inherit><purpose>Circular buffer - a STL compliant container. </purpose><description><para>
<formalpara><title>Type Requirements T</title><para>The <computeroutput>T</computeroutput> has to be <ulink url="https://www.boost.org/sgi/stl/Assignable.html">SGIAssignable</ulink> (SGI STL defined combination of <ulink url="../../../utility/Assignable.html">Assignable</ulink> and <ulink url="../../../utility/CopyConstructible.html">CopyConstructible</ulink>). Moreover <computeroutput>T</computeroutput> has to be <ulink url="https://www.boost.org/sgi/stl/DefaultConstructible.html">DefaultConstructible</ulink> if supplied as a default parameter when invoking some of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>'s methods e.g. <computeroutput>insert(iterator pos, const value_type&amp; item = value_type())</computeroutput>. And <ulink url="https://www.boost.org/sgi/stl/EqualityComparable.html">EqualityComparable</ulink> and/or <ulink url="../../../utility/LessThanComparable.html">LessThanComparable</ulink> if the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be compared with another container. </para>
</formalpara>

<formalpara><title>Type Requirements Alloc</title><para>The <computeroutput>Alloc</computeroutput> has to meet the allocator requirements imposed by STL. </para>
</formalpara>
<formalpara><title>Default Alloc</title><para>std::allocator&lt;T&gt;</para>
</formalpara>
For detailed documentation of the <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link> visit: <ulink url="http://www.boost.org/libs/circular_buffer/doc/circular_buffer.html">http://www.boost.org/libs/circular_buffer/doc/circular_buffer.html</ulink> </para></description><typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a75be8d9a8432fe32dbebb2470ba4e0b3" name="this_type"><purpose>The type of this <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a79750ba911a44a21fc0309f19e052710" name="value_type"><purpose>The type of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><type>Alloc::value_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac76167c559a8cf510040d64c4ae8dab9" name="pointer"><purpose>A pointer to an element. </purpose><type>allocator_pointer&lt; Alloc &gt;::type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a1b6e0fe4b63952c966e24c41365db5a3" name="const_pointer"><purpose>A const pointer to the element. </purpose><type>allocator_const_pointer&lt; Alloc &gt;::type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8b915dffbef141eb1923f15f885d7fea" name="reference"><purpose>A reference to an element. </purpose><type>value_type &amp;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1abffbff1418a385b353d7c7fd7f786ca2" name="const_reference"><purpose>A const reference to an element. </purpose><type>const value_type &amp;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aae5498ae03fe0c219c11edba62e4ddd2" name="difference_type"><purpose>The distance type. </purpose><description><para>(A signed integral type used to represent the distance between two iterators.) </para></description><type>allocator_difference_type&lt; Alloc &gt;::type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8a673602f3eb9934ae0ddb748305d922" name="size_type"><purpose>The size type. </purpose><description><para>(An unsigned integral type that can represent any non-negative value of the container's distance type.) </para></description><type>allocator_size_type&lt; Alloc &gt;::type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a68a90e9da2c7176dbee216fe09710635" name="allocator_type"><purpose>The type of an allocator used in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><type>Alloc</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a4cb1504e22c5bfe6ff97e00f0800bf31" name="const_iterator"><purpose>A const (random access) iterator used to iterate through the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><type>cb_details::iterator&lt; <classname>circular_buffer</classname>&lt; T, Alloc &gt;, cb_details::const_traits&lt; Alloc &gt; &gt;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a034b668c16eaa1dac31453b27abb0aa0" name="iterator"><purpose>A (random access) iterator used to iterate through the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><type>cb_details::iterator&lt; <classname>circular_buffer</classname>&lt; T, Alloc &gt;, cb_details::nonconst_traits&lt; Alloc &gt; &gt;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1abf74ae7aacb8fbd25b424ab9b8f27325" name="const_reverse_iterator"><purpose>A const iterator used to iterate backwards through a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><type>std::reverse_iterator&lt; const_iterator &gt;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1acdc4072f7b6bced13d688b1e2458cb1c" name="reverse_iterator"><purpose>An iterator used to iterate backwards through a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><type>std::reverse_iterator&lt; iterator &gt;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3cde5d53ca6ba1ea99b85f1eae39bcca" name="array_range"><purpose>An array range. </purpose><description><para>(A typedef for the <ulink url="https://www.boost.org/sgi/stl/pair.html"><computeroutput>std::pair</computeroutput></ulink> where its first element is a pointer to a beginning of an array and its second element represents a size of the array.) </para></description><type>std::pair&lt; pointer, size_type &gt;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab57c3bc800f80272296b2c57a886d0d8" name="const_array_range"><purpose>A range of a const array. </purpose><description><para>(A typedef for the <ulink url="https://www.boost.org/sgi/stl/pair.html"><computeroutput>std::pair</computeroutput></ulink> where its first element is a pointer to a beginning of a const array and its second element represents a size of the const array.) </para></description><type>std::pair&lt; const_pointer, size_type &gt;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a37a88d6c4dc2d8ba56304bba7f497731" name="capacity_type"><purpose>The capacity type. </purpose><description><para>(Same as <computeroutput>size_type</computeroutput> - defined for consistency with the __cbso class. </para></description><type>size_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9507850af6222bc053d59eb4865e1eaf" name="param_value_type"><purpose>A type representing the "best" way to pass the value_type to a method. </purpose><type>const value_type &amp;</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a597f5f46ddc9435e5bd94e9af7df86da" name="rvalue_type"><description><para>A type representing rvalue from param type. On compilers without rvalue references support this type is the Boost.Moves type used for emulation. </para></description><type>value_type &amp;&amp;</type></typedef>
<method-group name="public member functions">
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac315cb9a22e31af41ac9efeb1836ba68" name="get_allocator" cv="const noexcept"><type>allocator_type</type><purpose>Get the allocator. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac315cb9a22e31af41ac9efeb1836ba68">get_allocator()</link></computeroutput> for obtaining an allocator reference. </para>
</formalpara>
</para></description><returns><para>The allocator. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ffd431aa11c38cba209b7d191a36110" name="get_allocator" cv="noexcept"><type>allocator_type &amp;</type><purpose>Get the allocator reference. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<note><para>This method was added in order to optimize obtaining of the allocator with a state, although use of stateful allocators in STL is discouraged. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac315cb9a22e31af41ac9efeb1836ba68">get_allocator() const</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A reference to the allocator. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11" name="begin" cv="noexcept"><type>iterator</type><purpose>Get the iterator pointing to the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a4e3201eba77e8343823435c69fbb6f1d">rbegin()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a2863d6c874ab4ce5a83ed58d462f46bc">rend()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A random access iterator pointing to the first element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554" name="end" cv="noexcept"><type>iterator</type><purpose>Get the iterator pointing to the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a4e3201eba77e8343823435c69fbb6f1d">rbegin()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a2863d6c874ab4ce5a83ed58d462f46bc">rend()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A random access iterator pointing to the element "one behind" the last element of the <computeroutput> <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7e8b53f1c803e2ba81c547b237f14d5e" name="begin" cv="const noexcept"><type>const_iterator</type><purpose>Get the const iterator pointing to the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa403615f002df7c50de1a8111c56ceb0">end() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab173f33153dbf9ac1c58cd2e4b10fbc6">rbegin() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9cfdfdc6f5e4f9a675f43c5e4a9ceec2">rend() const</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A const random access iterator pointing to the first element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa403615f002df7c50de1a8111c56ceb0">end() const</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac38e4f777804df6051cbde13ff9629a4" name="cbegin" cv="const noexcept"><type>const_iterator</type></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa403615f002df7c50de1a8111c56ceb0" name="end" cv="const noexcept"><type>const_iterator</type><purpose>Get the const iterator pointing to the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7e8b53f1c803e2ba81c547b237f14d5e">begin() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab173f33153dbf9ac1c58cd2e4b10fbc6">rbegin() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9cfdfdc6f5e4f9a675f43c5e4a9ceec2">rend() const</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A const random access iterator pointing to the element "one behind" the last element of the <computeroutput> <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7e8b53f1c803e2ba81c547b237f14d5e">begin() const</link></computeroutput> const. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afb67314b29c871ea3412676a7606a950" name="cend" cv="const noexcept"><type>const_iterator</type></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a4e3201eba77e8343823435c69fbb6f1d" name="rbegin" cv="noexcept"><type>reverse_iterator</type><purpose>Get the iterator pointing to the beginning of the "reversed" <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a2863d6c874ab4ce5a83ed58d462f46bc">rend()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A reverse random access iterator pointing to the last element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a2863d6c874ab4ce5a83ed58d462f46bc">rend()</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a2863d6c874ab4ce5a83ed58d462f46bc" name="rend" cv="noexcept"><type>reverse_iterator</type><purpose>Get the iterator pointing to the end of the "reversed" <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a4e3201eba77e8343823435c69fbb6f1d">rbegin()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A reverse random access iterator pointing to the element "one before" the first element of the <computeroutput> <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a4e3201eba77e8343823435c69fbb6f1d">rbegin()</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab173f33153dbf9ac1c58cd2e4b10fbc6" name="rbegin" cv="const noexcept"><type>const_reverse_iterator</type><purpose>Get the const iterator pointing to the beginning of the "reversed" <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9cfdfdc6f5e4f9a675f43c5e4a9ceec2">rend() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7e8b53f1c803e2ba81c547b237f14d5e">begin() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa403615f002df7c50de1a8111c56ceb0">end() const</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A const reverse random access iterator pointing to the last element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9cfdfdc6f5e4f9a675f43c5e4a9ceec2">rend() const</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9cfdfdc6f5e4f9a675f43c5e4a9ceec2" name="rend" cv="const noexcept"><type>const_reverse_iterator</type><purpose>Get the const iterator pointing to the end of the "reversed" <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab173f33153dbf9ac1c58cd2e4b10fbc6">rbegin() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7e8b53f1c803e2ba81c547b237f14d5e">begin() const</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa403615f002df7c50de1a8111c56ceb0">end() const</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A const reverse random access iterator pointing to the element "one before" the first element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty it returns an iterator equal to the one returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab173f33153dbf9ac1c58cd2e4b10fbc6">rbegin() const</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad219f0d3203fb43b964a8cf63f1865cd" name="operator[]"><type>reference</type><parameter name="index"><paramtype>size_type</paramtype><description><para>The position of the element. </para></description></parameter><purpose>Get the element at the <computeroutput>index</computeroutput> position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1acd84838cb4fffb6c113fd0297e502edc">at()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>0 &lt;= index &amp;&amp; index &lt; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput> </para>
</requires><returns><para>A reference to the element at the <computeroutput>index</computeroutput> position. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a57ab04224d7c1581cc6df7d66e5f7b30" name="operator[]" cv="const"><type>const_reference</type><parameter name="index"><paramtype>size_type</paramtype><description><para>The position of the element. </para></description></parameter><purpose>Get the element at the <computeroutput>index</computeroutput> position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1abde0d9a447a665e0927731c3f922b634">at() const </link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>0 &lt;= index &amp;&amp; index &lt; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput> </para>
</requires><returns><para>A const reference to the element at the <computeroutput>index</computeroutput> position. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1acd84838cb4fffb6c113fd0297e502edc" name="at"><type>reference</type><parameter name="index"><paramtype>size_type</paramtype><description><para>The position of the element. </para></description></parameter><purpose>Get the element at the <computeroutput>index</computeroutput> position. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad219f0d3203fb43b964a8cf63f1865cd">operator[] </link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A reference to the element at the <computeroutput>index</computeroutput> position. </para>
</returns><throws><simpara><classname>&lt;code&gt;std::out_of_range&lt;/code&gt;</classname> when the <computeroutput>index</computeroutput> is invalid (when <computeroutput>index &gt;= <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput>). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1abde0d9a447a665e0927731c3f922b634" name="at" cv="const"><type>const_reference</type><parameter name="index"><paramtype>size_type</paramtype><description><para>The position of the element. </para></description></parameter><purpose>Get the element at the <computeroutput>index</computeroutput> position. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a57ab04224d7c1581cc6df7d66e5f7b30">operator[] const </link></computeroutput> </para>
</formalpara>
</para></description><returns><para>A const reference to the element at the <computeroutput>index</computeroutput> position. </para>
</returns><throws><simpara><classname>&lt;code&gt;std::out_of_range&lt;/code&gt;</classname> when the <computeroutput>index</computeroutput> is invalid (when <computeroutput>index &gt;= <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput>). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f" name="front"><type>reference</type><purpose>Get the first element. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a">back()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><returns><para>A reference to the first element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a" name="back"><type>reference</type><purpose>Get the last element. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f">front()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><returns><para>A reference to the last element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a237a2a1f2684eebfe448582ee6133b61" name="front" cv="const"><type>const_reference</type><purpose>Get the first element. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a53ff4930a515f1d679e2f404f0ba6c2c">back() const</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><returns><para>A const reference to the first element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a53ff4930a515f1d679e2f404f0ba6c2c" name="back" cv="const"><type>const_reference</type><purpose>Get the last element. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a237a2a1f2684eebfe448582ee6133b61">front() const</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><returns><para>A const reference to the last element of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d" name="array_one"><type>array_range</type><purpose>Get the first continuous array of the internal buffer. </purpose><description><para>This method in combination with <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput> can be useful when passing the stored data into a legacy C API as an array. Suppose there is a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> of capacity 10, containing 7 characters <computeroutput>'a', 'b', ..., 'g'</computeroutput> where <computeroutput>buff[0] == 'a'</computeroutput>, <computeroutput>buff[1] == 'b'</computeroutput>, ... and <computeroutput>buff[6] == 'g'</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>circular_buffer&lt;char&gt; buff(10);</computeroutput><sbr/>
<sbr/>
 The internal representation is often not linear and the state of the internal buffer may look like this:<sbr/>
 <sbr/>
<computeroutput> |e|f|g| | | |a|b|c|d|<sbr/>
 end ___^<sbr/>
 begin _______^</computeroutput><sbr/>
<sbr/>
</para><para>where <computeroutput>|a|b|c|d|</computeroutput> represents the "array one", <computeroutput>|e|f|g|</computeroutput> represents the "array two" and <computeroutput>| | | |</computeroutput> is a free space.<sbr/>
 Now consider a typical C style function for writing data into a file:<sbr/>
<sbr/>
 <computeroutput>int write(int file_desc, char* buff, int num_bytes);</computeroutput><sbr/>
<sbr/>
 There are two ways how to write the content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> into a file. Either relying on <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput> and <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput> methods and calling the write function twice:<sbr/>
<sbr/>
 <computeroutput>array_range ar = buff.array_one();<sbr/>
 write(file_desc, ar.first, ar.second);<sbr/>
 ar = buff.array_two();<sbr/>
 write(file_desc, ar.first, ar.second);</computeroutput><sbr/>
<sbr/>
 Or relying on the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aea728bf57f91aa8946eddf76ce816a4e">linearize()</link></computeroutput> method:<sbr/>
<sbr/>
<computeroutput> write(file_desc, buff.linearize(), buff.size());</computeroutput><sbr/>
<sbr/>
 Since the complexity of <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput> and <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput> methods is constant the first option is suitable when calling the write method is "cheap". On the other hand the second option is more suitable when calling the write method is more "expensive" than calling the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aea728bf57f91aa8946eddf76ce816a4e">linearize()</link></computeroutput> method whose complexity is linear. 

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<warning><para>In general invoking any method which modifies the internal state of the <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link> may delinearize the internal buffer and invalidate the array ranges returned by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput> and <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput> (and their const versions). </para>
</warning>
<note><para>In the case the internal buffer is linear e.g. <computeroutput>|a|b|c|d|e|f|g| | | |</computeroutput> the "array one" is represented by <computeroutput>|a|b|c|d|e|f|g|</computeroutput> and the "array two" does not exist (the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput> method returns an array with the size <computeroutput>0</computeroutput>). </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aea728bf57f91aa8946eddf76ce816a4e">linearize()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>The array range of the first continuous array of the internal buffer. In the case the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty the size of the returned array is <computeroutput>0</computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b" name="array_two"><type>array_range</type><purpose>Get the second continuous array of the internal buffer. </purpose><description><para>This method in combination with <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput> can be useful when passing the stored data into a legacy C API as an array. 

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>The array range of the second continuous array of the internal buffer. In the case the internal buffer is linear or the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty the size of the returned array is <computeroutput>0</computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a586cfbdef335f1d3d31faacec63f7b04" name="array_one" cv="const"><type>const_array_range</type><purpose>Get the first continuous array of the internal buffer. </purpose><description><para>This method in combination with <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a91a0e2c33c0e5b4d7b8c497847bc29ce">array_two() const</link></computeroutput> can be useful when passing the stored data into a legacy C API as an array. 

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a91a0e2c33c0e5b4d7b8c497847bc29ce">array_two() const</link></computeroutput>; <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput> for more details how to pass data into a legacy C API. </para>
</formalpara>
</para></description><returns><para>The array range of the first continuous array of the internal buffer. In the case the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty the size of the returned array is <computeroutput>0</computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a91a0e2c33c0e5b4d7b8c497847bc29ce" name="array_two" cv="const"><type>const_array_range</type><purpose>Get the second continuous array of the internal buffer. </purpose><description><para>This method in combination with <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a586cfbdef335f1d3d31faacec63f7b04">array_one() const</link></computeroutput> can be useful when passing the stored data into a legacy C API as an array. 

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a586cfbdef335f1d3d31faacec63f7b04">array_one() const</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>The array range of the second continuous array of the internal buffer. In the case the internal buffer is linear or the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is empty the size of the returned array is <computeroutput>0</computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aea728bf57f91aa8946eddf76ce816a4e" name="linearize"><type>pointer</type><purpose>Linearize the internal buffer into a continuous array. </purpose><description><para>This method can be useful when passing the stored data into a legacy C API as an array. 


<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>); does not invalidate any iterators if the postcondition (the <emphasis>Effect</emphasis>) is already met prior calling this method. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>); constant if the postcondition (the <emphasis>Effect</emphasis>) is already met. </para>
</formalpara>
<warning><para>In general invoking any method which modifies the internal state of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> may delinearize the internal buffer and invalidate the returned pointer. </para>
</warning>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput> and <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput> for the other option how to pass data into a legacy C API; <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a57daac6cfd6b5f7f9230ab5fcbf3a8f8">is_linearized()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac591bb9e271b10b5240afcff3bd2c619">rotate(const_iterator)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput>&amp;(*this)[0] &lt; &amp;(*this)[1] &lt; ... &lt; &amp;(*this)[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - 1]</computeroutput> </para>
</postconditions><returns><para>A pointer to the beginning of the array or <computeroutput>0</computeroutput> if empty. </para>
</returns><throws><simpara><classname>&lt;a</classname> href="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t"&gt;Exceptions of move_if_noexcept(T&amp;). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a57daac6cfd6b5f7f9230ab5fcbf3a8f8" name="is_linearized" cv="const noexcept"><type>bool</type><purpose>Is the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> linearized? </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aea728bf57f91aa8946eddf76ce816a4e">linearize()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a957cccdcb0c4ef7d80a34a990065818d">array_one()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af5081a54afbc2dfc1a7fb20329df7d5b">array_two()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>true</computeroutput> if the internal buffer is linearized into a continuous array (i.e. the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> meets a condition <computeroutput>&amp;(*this)[0] &lt; &amp;(*this)[1] &lt; ... &lt; &amp;(*this)[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - 1]</computeroutput>); <computeroutput>false</computeroutput> otherwise. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac591bb9e271b10b5240afcff3bd2c619" name="rotate"><type>void</type><parameter name="new_begin"><paramtype>const_iterator</paramtype><description><para>The new beginning. </para></description></parameter><purpose>Rotate elements in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>A more effective implementation of <computeroutput><ulink url="https://www.boost.org/sgi/stl/rotate.html">std::rotate</ulink></computeroutput>. 



<formalpara><title>Exception Safety</title><para>Basic; no-throw if the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full or <computeroutput>new_begin</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> or if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>If <computeroutput>m &lt; n</computeroutput> invalidates iterators pointing to the last <computeroutput>m</computeroutput> elements (<emphasis role="bold">including</emphasis> <computeroutput>new_begin</computeroutput>, but not iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>) else invalidates iterators pointing to the first <computeroutput>n</computeroutput> elements; does not invalidate any iterators if the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>(std::min)(m, n)</computeroutput>); constant if the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><ulink url="https://www.boost.org/sgi/stl/rotate.html">std::rotate</ulink></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>new_begin</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> <emphasis role="bold">except</emphasis> its end. </para>
</requires><postconditions><para>Before calling the method suppose:<sbr/>
<sbr/>
 <computeroutput>m == std::distance(new_begin, end())</computeroutput><sbr/>
<computeroutput>n == std::distance(begin(), new_begin)</computeroutput> <sbr/>
<computeroutput>val_0 == *new_begin, val_1 == *(new_begin + 1), ... val_m == *(new_begin + m)</computeroutput><sbr/>
 <computeroutput>val_r1 == *(new_begin - 1), val_r2 == *(new_begin - 2), ... val_rn == *(new_begin - n)</computeroutput><sbr/>
 <sbr/>
then after call to the method:<sbr/>
<sbr/>
 <computeroutput>val_0 == (*this)[0] &amp;&amp; val_1 == (*this)[1] &amp;&amp; ... &amp;&amp; val_m == (*this)[m - 1] &amp;&amp; val_r1 == (*this)[m + n - 1] &amp;&amp; val_r2 == (*this)[m + n - 2] &amp;&amp; ... &amp;&amp; val_rn == (*this)[m]</computeroutput> </para>
</postconditions><throws><simpara><classname>See</classname> <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750" name="size" cv="const noexcept"><type>size_type</type><purpose>Get the number of elements currently stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac7f5acdb90f95aabcdd81be2a9258dc4">max_size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a80c2e2e66a8fa9d0b7adc1b54921a8c3">resize(size_type, const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>The number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac7f5acdb90f95aabcdd81be2a9258dc4" name="max_size" cv="const noexcept"><type>size_type</type><purpose>Get the largest possible size or capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. (It depends on allocator's max_size()). </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>The maximum size/capacity the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> can be set to. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a12c932f15d9028d99dd87ae890e60088" name="empty" cv="const noexcept"><type>bool</type><purpose>Is the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> empty? </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6963b3b12c05b645370828f01eaf302d">full()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>true</computeroutput> if there are no elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>; <computeroutput>false</computeroutput> otherwise. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6963b3b12c05b645370828f01eaf302d" name="full" cv="const noexcept"><type>bool</type><purpose>Is the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> full? </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a12c932f15d9028d99dd87ae890e60088">empty()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>true</computeroutput> if the number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> equals the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>; <computeroutput>false</computeroutput> otherwise. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc" name="reserve" cv="const noexcept"><type>size_type</type><purpose>Get the maximum number of elements which can be inserted into the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> without overwriting any of already stored elements. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac7f5acdb90f95aabcdd81be2a9258dc4">max_size()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5" name="capacity" cv="const noexcept"><type>capacity_type</type><purpose>Get the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac7f5acdb90f95aabcdd81be2a9258dc4">max_size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a61714204ef5172d156e2c7eccd04998f">set_capacity(capacity_type)</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>The maximum number of elements which can be stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a61714204ef5172d156e2c7eccd04998f" name="set_capacity"><type>void</type><parameter name="new_capacity"><paramtype>capacity_type</paramtype><description><para>The new capacity. </para></description></parameter><purpose>Change the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>) if the new capacity is different from the original. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link>, new_capacity]</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a477715e9d31d2cc5b02ad8ecf3c68c46">rset_capacity(capacity_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a80c2e2e66a8fa9d0b7adc1b54921a8c3">resize(size_type, const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>If <computeroutput>T</computeroutput> is a move only type, then compiler shall support <computeroutput>noexcept</computeroutput> modifiers and move constructor of <computeroutput>T</computeroutput> must be marked with it (must not throw exceptions). </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == new_capacity &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= new_capacity</computeroutput><sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is greater than the desired new capacity then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - new_capacity]</computeroutput> <emphasis role="bold">last</emphasis> elements will be removed and the new size will be equal to <computeroutput>new_capacity</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted, (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a80c2e2e66a8fa9d0b7adc1b54921a8c3" name="resize"><type>void</type><parameter name="new_size"><paramtype>size_type</paramtype><description><para>The new size. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><default>value_type()</default><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with in order to gain the requested size. (See the <emphasis>Effect</emphasis>.) </para></description></parameter><purpose>Change the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>) if the new size is greater than the current capacity. Invalidates iterators pointing to the removed elements if the new size is lower that the original size. Otherwise it does not invalidate any iterator. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the new size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a44ecd9ec5f54a2d61c7d132e445d3483">rresize(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a61714204ef5172d156e2c7eccd04998f">set_capacity(capacity_type)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == new_size &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt;= new_size</computeroutput><sbr/>
<sbr/>
 If the new size is greater than the current size, copies of <computeroutput>item</computeroutput> will be inserted at the <emphasis role="bold">back</emphasis> of the of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to <computeroutput>new_size</computeroutput>.<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is greater than the desired new size then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - new_size]</computeroutput> <emphasis role="bold">last</emphasis> elements will be removed. (The capacity will remain unchanged.) </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a477715e9d31d2cc5b02ad8ecf3c68c46" name="rset_capacity"><type>void</type><parameter name="new_capacity"><paramtype>capacity_type</paramtype><description><para>The new capacity. </para></description></parameter><purpose>Change the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>) if the new capacity is different from the original. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link>, new_capacity]</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a61714204ef5172d156e2c7eccd04998f">set_capacity(capacity_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a44ecd9ec5f54a2d61c7d132e445d3483">rresize(size_type, const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>If <computeroutput>T</computeroutput> is a move only type, then compiler shall support <computeroutput>noexcept</computeroutput> modifiers and move constructor of <computeroutput>T</computeroutput> must be marked with it (must not throw exceptions). </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == new_capacity &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= new_capacity</computeroutput><sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is greater than the desired new capacity then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - new_capacity]</computeroutput> <emphasis role="bold">first</emphasis> elements will be removed and the new size will be equal to <computeroutput>new_capacity</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a44ecd9ec5f54a2d61c7d132e445d3483" name="rresize"><type>void</type><parameter name="new_size"><paramtype>size_type</paramtype><description><para>The new size. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><default>value_type()</default><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with in order to gain the requested size. (See the <emphasis>Effect</emphasis>.) </para></description></parameter><purpose>Change the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>) if the new size is greater than the current capacity. Invalidates iterators pointing to the removed elements if the new size is lower that the original size. Otherwise it does not invalidate any iterator. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the new size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a80c2e2e66a8fa9d0b7adc1b54921a8c3">resize(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a477715e9d31d2cc5b02ad8ecf3c68c46">rset_capacity(capacity_type)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == new_size &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt;= new_size</computeroutput><sbr/>
<sbr/>
 If the new size is greater than the current size, copies of <computeroutput>item</computeroutput> will be inserted at the <emphasis role="bold">front</emphasis> of the of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to <computeroutput>new_size</computeroutput>.<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is greater than the desired new size then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - new_size]</computeroutput> <emphasis role="bold">first</emphasis> elements will be removed. (The capacity will remain unchanged.) </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a00b4cb2a7dd9c100008c05ba18c43575" specifiers="explicit" cv="noexcept"><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create an empty <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with zero capacity. </purpose><description><para>


<formalpara><title>Complexity</title><para>Constant. </para>
</formalpara>
<warning><para>Since Boost version 1.36 the behaviour of this constructor has changed. Now the constructor does not allocate any memory and both capacity and size are set to zero. Also note when inserting an element into a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with zero capacity (e.g. by <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8336fbe16305902701f36a1ccab18a27">push_back(const_reference)</link></computeroutput> or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>) nothing will be inserted and the size (as well as capacity) remains zero. </para>
</warning>
<note><para>You can explicitly set the capacity by calling the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a61714204ef5172d156e2c7eccd04998f">set_capacity(capacity_type)</link></computeroutput> method or you can use the other constructor with the capacity specified. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8f1606a26fead923c2cbe068a74e28b6">circular_buffer(capacity_type, const allocator_type&amp; alloc)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a61714204ef5172d156e2c7eccd04998f">set_capacity(capacity_type)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == 0 &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == 0</computeroutput> </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8f1606a26fead923c2cbe068a74e28b6" specifiers="explicit"><parameter name="buffer_capacity"><paramtype>capacity_type</paramtype><description><para>The maximum number of elements which can be stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create an empty <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the specified capacity. </purpose><description><para>


<formalpara><title>Complexity</title><para>Constant. </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == buffer_capacity &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == 0</computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afdace8f110d5b7a17c02020757f06fe8"><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create a full <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the specified capacity and filled with <computeroutput>n</computeroutput> copies of <computeroutput>item</computeroutput>. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>n</computeroutput>). </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == n &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6963b3b12c05b645370828f01eaf302d">full()</link> &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this)[n - 1] == item </computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a04dc644486d835b56aa479ec48b52230"><parameter name="buffer_capacity"><paramtype>capacity_type</paramtype><description><para>The capacity of the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the specified capacity and filled with <computeroutput>n</computeroutput> copies of <computeroutput>item</computeroutput>. </purpose><description><para>



<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>n</computeroutput>). </para>
</formalpara>
</para></description><requires><para><computeroutput>buffer_capacity &gt;= n</computeroutput> </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == buffer_capacity &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == n &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this)[n - 1] == item</computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae515d8a951eeb18b8cc930300e7e13bd"><parameter name="cb"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to be copied. </para></description></parameter><purpose>The copy constructor. </purpose><description><para>Creates a copy of the specified <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. 


<formalpara><title>Complexity</title><para>Linear (in the size of <computeroutput>cb</computeroutput>). </para>
</formalpara>
</para></description><postconditions><para><computeroutput>*this == cb</computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0ac37867a8b83c1bf0561ab85b4724ac" cv="noexcept"><parameter name="cb"><paramtype><classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;&amp;</paramtype><description><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to 'steal' value from. </para></description></parameter><purpose>The move constructor. </purpose><description><para>Move constructs a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> from <computeroutput>cb</computeroutput>, leaving <computeroutput>cb</computeroutput> empty. 



<formalpara><title>Constant.</title><para/>
</formalpara>
</para></description><requires><para>C++ compiler with rvalue references support. </para>
</requires><postconditions><para><computeroutput>cb.empty()</computeroutput> </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afeafb724baaeeb8dbb73ea653edf4357"><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create a full <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> filled with a copy of the range. </purpose><description><para>



<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>std::distance(first, last)</computeroutput>). </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == std::distance(first, last) &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6963b3b12c05b645370828f01eaf302d">full()</link> &amp;&amp; (*this)[0]== *first &amp;&amp; (*this)[1] == *(first + 1) &amp;&amp; ... &amp;&amp; (*this)[std::distance(first, last) - 1] == *(last - 1)</computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a84ba541b484a33c32e15dcbca0db03af"><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="buffer_capacity"><paramtype>capacity_type</paramtype><description><para>The capacity of the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the specified capacity and filled with a copy of the range. </purpose><description><para>



<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(first, last)</computeroutput>; in <computeroutput>min[capacity, std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == buffer_capacity &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= std::distance(first, last) &amp;&amp; (*this)[0]== *(last - buffer_capacity) &amp;&amp; (*this)[1] == *(last - buffer_capacity + 1) &amp;&amp; ... &amp;&amp; (*this)[buffer_capacity - 1] == *(last - 1)</computeroutput><sbr/>
<sbr/>
 If the number of items to be copied from the range <computeroutput>[first, last)</computeroutput> is greater than the specified <computeroutput>buffer_capacity</computeroutput> then only elements from the range <computeroutput>[last - buffer_capacity, last)</computeroutput> will be copied. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<destructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a2d5b47d69b70eacfa7aa5377ad265d54" cv="noexcept"><purpose>The destructor. </purpose><description><para>Destroys the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. 
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (including iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>) for scalar types; linear for other types. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4">clear()</link></computeroutput> </para>
</formalpara>
</para></description><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></destructor>
<copy-assignment id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afab331a43b2aec0ccb2a03ceac99a952"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</type><parameter name="cb"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to be copied. </para></description></parameter><purpose>The assign operator. </purpose><description><para>Makes this <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to become a copy of the specified <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. 


<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to this <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of <computeroutput>cb</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9ba4a81df16f386d31b04b49c82d1ada">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adbebb80a5f38e52a37ec9f3ed765600a">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5e65fbd9d81032aec96e51a21bb38e05">assign(InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a1535033eb7eef6d3e9644225362a06cb">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput>*this == cb</computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></copy-assignment>
<copy-assignment id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a4c8e85b34cf33bca96bc5ab1910c947a" cv="noexcept"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</type><parameter name="cb"><paramtype><classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;&amp;</paramtype><description><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to 'steal' value from. </para></description></parameter><purpose>Move assigns content of <computeroutput>cb</computeroutput> to <computeroutput>*this</computeroutput>, leaving <computeroutput>cb</computeroutput> empty. </purpose><description><para>



<formalpara><title>Complexity</title><para>Constant. </para>
</formalpara>
</para></description><requires><para>C++ compiler with rvalue references support. </para>
</requires><postconditions><para><computeroutput>cb.empty()</computeroutput> </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></copy-assignment>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9ba4a81df16f386d31b04b49c82d1ada" name="assign"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><purpose>Assign <computeroutput>n</computeroutput> items into the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>The content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be removed and replaced with <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput>. 


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>n</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afab331a43b2aec0ccb2a03ceac99a952">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adbebb80a5f38e52a37ec9f3ed765600a">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5e65fbd9d81032aec96e51a21bb38e05">assign(InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a1535033eb7eef6d3e9644225362a06cb">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == n &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == n &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this) [n - 1] == item</computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adbebb80a5f38e52a37ec9f3ed765600a" name="assign"><type>void</type><parameter name="buffer_capacity"><paramtype>capacity_type</paramtype><description><para>The new capacity. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be filled with. </para></description></parameter><purpose>Assign <computeroutput>n</computeroutput> items into the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> specifying the capacity. </purpose><description><para>The capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be set to the specified value and the content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be removed and replaced with <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput>. 



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>n</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afab331a43b2aec0ccb2a03ceac99a952">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9ba4a81df16f386d31b04b49c82d1ada">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5e65fbd9d81032aec96e51a21bb38e05">assign(InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a1535033eb7eef6d3e9644225362a06cb">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>capacity &gt;= n</computeroutput> </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == buffer_capacity &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == n &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this) [n - 1] == item </computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5e65fbd9d81032aec96e51a21bb38e05" name="assign"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><purpose>Assign a copy of the range into the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>The content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be removed and replaced with copies of elements from the specified range. 



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>std::distance(first, last)</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afab331a43b2aec0ccb2a03ceac99a952">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9ba4a81df16f386d31b04b49c82d1ada">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adbebb80a5f38e52a37ec9f3ed765600a">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a1535033eb7eef6d3e9644225362a06cb">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == std::distance(first, last) &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == std::distance(first, last) &amp;&amp; (*this)[0]== *first &amp;&amp; (*this)[1] == *(first + 1) &amp;&amp; ... &amp;&amp; (*this)[std::distance(first, last) - 1] == *(last - 1)</computeroutput> </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a1535033eb7eef6d3e9644225362a06cb" name="assign"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="buffer_capacity"><paramtype>capacity_type</paramtype><description><para>The new capacity. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><purpose>Assign a copy of the range into the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> specifying the capacity. </purpose><description><para>The capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be set to the specified value and the content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be removed and replaced with copies of elements from the specified range. 



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(first, last)</computeroutput>; in <computeroutput>min[capacity, std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afab331a43b2aec0ccb2a03ceac99a952">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a9ba4a81df16f386d31b04b49c82d1ada">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adbebb80a5f38e52a37ec9f3ed765600a">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5e65fbd9d81032aec96e51a21bb38e05">assign(InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> == buffer_capacity &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= std::distance(first, last) &amp;&amp; (*this)[0]== *(last - buffer_capacity) &amp;&amp; (*this)[1] == *(last - buffer_capacity + 1) &amp;&amp; ... &amp;&amp; (*this)[buffer_capacity - 1] == *(last - 1)</computeroutput><sbr/>
<sbr/>
 If the number of items to be copied from the range <computeroutput>[first, last)</computeroutput> is greater than the specified <computeroutput>buffer_capacity</computeroutput> then only elements from the range <computeroutput>[last - buffer_capacity, last)</computeroutput> will be copied. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a44f5c09565b40cf10c2159b33103373d" name="swap" cv="noexcept"><type>void</type><parameter name="cb"><paramtype><classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> whose content will be swapped. </para></description></parameter><purpose>Swap the contents of two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators of both <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s. (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 <ulink url="#debug">Debug Support</ulink> off otherwise an assertion will report an error if such invalidated iterator is used.) </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput>swap(circular_buffer&lt;T, Alloc&gt;&amp;, circular_buffer&lt;T, Alloc&gt;&amp;)</computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput>this</computeroutput> contains elements of <computeroutput>cb</computeroutput> and vice versa; the capacity of <computeroutput>this</computeroutput> equals to the capacity of <computeroutput>cb</computeroutput> and vice versa. </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad5713b35fbb5bbd57e32fe0abe24e416" name="push_back"><type>void</type><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators with the exception of iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a5a1e9cc6d986d82688cdbb9ff770b9">push_front(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a">back()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the first element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac02bb15ccca7fb46f47f1eb9bca1a1eb" name="push_back"><type>void</type><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> using rvalue references or rvalues references emulation. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators with the exception of iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a5a1e9cc6d986d82688cdbb9ff770b9">push_front(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a">back()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the first element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8336fbe16305902701f36a1ccab18a27" name="push_back"><type>void</type><purpose>Insert a new default-constructed element at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators with the exception of iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a5a1e9cc6d986d82688cdbb9ff770b9">push_front(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a">back()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the first element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ade5de511163a6ae84430f593a818aaaa" name="push_front"><type>void</type><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators with the exception of iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8336fbe16305902701f36a1ccab18a27">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f">front()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the last element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a492189d6628bd8d5590ab61ad2058646" name="push_front"><type>void</type><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> using rvalue references or rvalues references emulation. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators with the exception of iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8336fbe16305902701f36a1ccab18a27">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f">front()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the last element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a5a1e9cc6d986d82688cdbb9ff770b9" name="push_front"><type>void</type><purpose>Insert a new default-constructed element at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators with the exception of iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8336fbe16305902701f36a1ccab18a27">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link> &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f">front()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the last element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07" name="pop_back"><type>void</type><purpose>Remove the last element from the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates only iterators pointing to the removed element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8">pop_front()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8336fbe16305902701f36a1ccab18a27">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a5a1e9cc6d986d82688cdbb9ff770b9">push_front(const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><postconditions><para>The last element is removed from the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8ac972dc24ef7236faa1875de92b9dd8" name="pop_front"><type>void</type><purpose>Remove the first element from the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates only iterators pointing to the removed element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1adf0da00cb501bea75afbbfab9f546a07">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a8336fbe16305902701f36a1ccab18a27">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a5a1e9cc6d986d82688cdbb9ff770b9">push_front(const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><postconditions><para>The first element is removed from the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218" name="insert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements at the insertion point (including <computeroutput>pos</computeroutput>) and iterators behind the insertion point (towards the end; except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). It also invalidates iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(pos, end())</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the first element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>.</simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1afeb57e73b9230a7b3f52f84d42affcd8" name="insert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements at the insertion point (including <computeroutput>pos</computeroutput>) and iterators behind the insertion point (towards the end; except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). It also invalidates iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(pos, end())</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the first element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a48ef34391874de88ce29eec1c4a8a90d" name="insert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><purpose>Insert a default-constructed element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements at the insertion point (including <computeroutput>pos</computeroutput>) and iterators behind the insertion point (towards the end; except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). It also invalidates iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(pos, end())</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the first element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>Whatever</classname> <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140" name="insert"><type>void</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput>s will be inserted. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of <computeroutput>item</computeroutput>s the to be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element whose copies will be inserted. </para></description></parameter><purpose>Insert <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput> at the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements at the insertion point (including <computeroutput>pos</computeroutput>) and iterators behind the insertion point (towards the end; except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). It also invalidates iterators pointing to the overwritten elements. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link>, std::distance(pos, end()) + n]</computeroutput>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting 5 elements at the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>insert(p, (size_t)5, 0);</computeroutput><sbr/>
<sbr/>
actually only 4 elements get inserted and elements <computeroutput>1</computeroutput> and <computeroutput>2</computeroutput> are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|0|0|0|0|3|4|</computeroutput><sbr/>
 <sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|0|0|0|0|0|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The number of <computeroutput>min[n, (pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>) + <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>]</computeroutput> elements will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>, max[0, n - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>]]</computeroutput> elements will be overwritten at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.) </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e" name="insert"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the range will be inserted. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be inserted. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be inserted. </para></description></parameter><purpose>Insert the range <computeroutput>[first, last)</computeroutput> at the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements at the insertion point (including <computeroutput>pos</computeroutput>) and iterators behind the insertion point (towards the end; except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). It also invalidates iterators pointing to the overwritten elements. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>[std::distance(pos, end()) + std::distance(first, last)]</computeroutput>; in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link>, std::distance(pos, end()) + std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting a range of elements at the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>int array[] = { 5, 6, 7, 8, 9 };</computeroutput><sbr/>
<computeroutput>insert(p, array, array + 5);</computeroutput><sbr/>
<sbr/>
 actually only elements <computeroutput>6</computeroutput>, <computeroutput>7</computeroutput>, <computeroutput>8</computeroutput> and <computeroutput>9</computeroutput> from the specified range get inserted and elements <computeroutput>1</computeroutput> and <computeroutput>2</computeroutput> are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|6|7|8|9|3|4|</computeroutput><sbr/>
<sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|5|6|7|8|9|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end.<sbr/>
 Valid range <computeroutput>[first, last)</computeroutput> where <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> meet the requirements of an <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para>Elements from the range <computeroutput>[first + max[0, distance(first, last) - (pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>], last)</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>, max[0, distance(first, last) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>]]</computeroutput> elements will be overwritten at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.) </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is not a move iterator. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is not a move iterator. Whatever <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is a move iterator. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is a move iterator. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98" name="rinsert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position before which the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element before the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements before the insertion point (towards the beginning and excluding <computeroutput>pos</computeroutput>). It also invalidates iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(begin(), pos)</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the last element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a65f3c0fd966b641119af69c130fc4e60" name="rinsert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position before which the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element before the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements before the insertion point (towards the beginning and excluding <computeroutput>pos</computeroutput>). It also invalidates iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(begin(), pos)</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the last element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0dc49a50395f5d7711543e37fbf2d90a" name="rinsert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position before which the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><purpose>Insert an element before the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements before the insertion point (towards the beginning and excluding <computeroutput>pos</computeroutput>). It also invalidates iterators pointing to the overwritten element. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(begin(), pos)</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full, the last element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>Whatever</classname> <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5" name="rinsert"><type>void</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput>s will be inserted. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of <computeroutput>item</computeroutput>s the to be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element whose copies will be inserted. </para></description></parameter><purpose>Insert <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput> before the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements before the insertion point (towards the beginning and excluding <computeroutput>pos</computeroutput>). It also invalidates iterators pointing to the overwritten elements. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link>, std::distance(begin(), pos) + n]</computeroutput>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting 5 elements before the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>rinsert(p, (size_t)5, 0);</computeroutput><sbr/>
<sbr/>
actually only 4 elements get inserted and elements <computeroutput>3</computeroutput> and <computeroutput>4</computeroutput> are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|1|2|0|0|0|0|</computeroutput><sbr/>
 <sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|0|0|0|0|0|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end. </para>
</requires><postconditions><para>The number of <computeroutput>min[n, (<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos) + <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>]</computeroutput> elements will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos, max[0, n - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>]]</computeroutput> elements will be overwritten at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.) </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. <ulink url="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t">Exceptions of move_if_noexcept(T&amp;)</ulink>. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aadf79a9cd00aecc3a076a6956027a70e" name="rinsert"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the range will be inserted. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be inserted. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be inserted. </para></description></parameter><purpose>Insert the range <computeroutput>[first, last)</computeroutput> before the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operations in the <emphasis>Throws</emphasis> section do not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the elements before the insertion point (towards the beginning and excluding <computeroutput>pos</computeroutput>). It also invalidates iterators pointing to the overwritten elements. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>[std::distance(begin(), pos) + std::distance(first, last)]</computeroutput>; in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ae1f61acf2bd07c39b15e928d3e87c1c5">capacity()</link>, std::distance(begin(), pos) + std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting a range of elements before the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>int array[] = { 5, 6, 7, 8, 9 };</computeroutput><sbr/>
<computeroutput>insert(p, array, array + 5);</computeroutput><sbr/>
<sbr/>
 actually only elements <computeroutput>5</computeroutput>, <computeroutput>6</computeroutput>, <computeroutput>7</computeroutput> and <computeroutput>8</computeroutput> from the specified range get inserted and elements <computeroutput>3</computeroutput> and <computeroutput>4</computeroutput> are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|1|2|5|6|7|8|</computeroutput><sbr/>
<sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|5|6|7|8|9|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a6ddcf8cb37fc2c9819642a33c767ef98">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa47a5358db1b7d7e4925c16db13d2fc5">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad2dcee0374472ecba13d73260486e218">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab2f197c99d47138db777f0a46783b140">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aca598b20377d967ac1ae6d690aee7b0e">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> or its end.<sbr/>
 Valid range <computeroutput>[first, last)</computeroutput> where <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> meet the requirements of an <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para>Elements from the range <computeroutput>[first, last - max[0, distance(first, last) - (<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>])</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos, max[0, distance(first, last) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3a88dbc1b98ab314f7621fc312ae12fc">reserve()</link>]]</computeroutput> elements will be overwritten at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.) </para>
</postconditions><throws><simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is not a move iterator. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is not a move iterator. Whatever <computeroutput>T::T(T&amp;&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is a move iterator. Whatever <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> throws if the <computeroutput>InputIterator</computeroutput> is a move iterator. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3" name="erase"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator pointing at the element to be removed. </para></description></parameter><purpose>Remove an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the erased element and iterators pointing to the elements behind the erased element (towards the end; except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(pos, end())</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab6d4ae77d7445f844e30e78592f1e06f">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab25d379cf66ace025036a47ddb344abd">erase_begin(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7485ee7f58b01363170114f2123a48d7">erase_end(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (but not an <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</requires><postconditions><para>The element at the position <computeroutput>pos</computeroutput> is removed. </para>
</postconditions><returns><para>Iterator to the first element remaining beyond the removed element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>&lt;a</classname> href="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t"&gt;Exceptions of move_if_noexcept(T&amp;). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd" name="erase"><type>iterator</type><parameter name="first"><paramtype>iterator</paramtype><description><para>The beginning of the range to be removed. </para></description></parameter><parameter name="last"><paramtype>iterator</paramtype><description><para>The end of the range to be removed. </para></description></parameter><purpose>Erase the range <computeroutput>[first, last)</computeroutput>. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the erased elements and iterators pointing to the elements behind the erased range (towards the end; except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(first, end())</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab6d4ae77d7445f844e30e78592f1e06f">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab25d379cf66ace025036a47ddb344abd">erase_begin(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7485ee7f58b01363170114f2123a48d7">erase_end(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>. </para>
</requires><postconditions><para>The elements from the range <computeroutput>[first, last)</computeroutput> are removed. (If <computeroutput>first == last</computeroutput> nothing is removed.) </para>
</postconditions><returns><para>Iterator to the first element remaining beyond the removed elements or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>&lt;a</classname> href="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t"&gt;Exceptions of move_if_noexcept(T&amp;). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab6d4ae77d7445f844e30e78592f1e06f" name="rerase"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator pointing at the element to be removed. </para></description></parameter><purpose>Remove an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the erased element and iterators pointing to the elements in front of the erased element (towards the beginning). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(begin(), pos)</computeroutput>). </para>
</formalpara>
<note><para>This method is symmetric to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput> method and is more effective than <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput> if the iterator <computeroutput>pos</computeroutput> is close to the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. (See the <emphasis>Complexity</emphasis>.) </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab25d379cf66ace025036a47ddb344abd">erase_begin(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7485ee7f58b01363170114f2123a48d7">erase_end(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (but not an <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</requires><postconditions><para>The element at the position <computeroutput>pos</computeroutput> is removed. </para>
</postconditions><returns><para>Iterator to the first element remaining in front of the removed element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>&lt;a</classname> href="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t"&gt;Exceptions of move_if_noexcept(T&amp;). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f" name="rerase"><type>iterator</type><parameter name="first"><paramtype>iterator</paramtype><description><para>The beginning of the range to be removed. </para></description></parameter><parameter name="last"><paramtype>iterator</paramtype><description><para>The end of the range to be removed. </para></description></parameter><purpose>Erase the range <computeroutput>[first, last)</computeroutput>. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the erased elements and iterators pointing to the elements in front of the erased range (towards the beginning). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(begin(), last)</computeroutput>). </para>
</formalpara>
<note><para>This method is symmetric to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput> method and is more effective than <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput> if <computeroutput>std::distance(begin(), first)</computeroutput> is lower that <computeroutput>std::distance(last, end())</computeroutput>. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab6d4ae77d7445f844e30e78592f1e06f">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab25d379cf66ace025036a47ddb344abd">erase_begin(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7485ee7f58b01363170114f2123a48d7">erase_end(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>. </para>
</requires><postconditions><para>The elements from the range <computeroutput>[first, last)</computeroutput> are removed. (If <computeroutput>first == last</computeroutput> nothing is removed.) </para>
</postconditions><returns><para>Iterator to the first element remaining in front of the removed elements or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>&lt;a</classname> href="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t"&gt;Exceptions of move_if_noexcept(T&amp;). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab25d379cf66ace025036a47ddb344abd" name="erase_begin"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements to be removed. </para></description></parameter><purpose>Remove first <computeroutput>n</computeroutput> elements (with constant complexity for scalar types). </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. (I.e. no throw in case of scalars.) </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the first <computeroutput>n</computeroutput> erased elements. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in <computeroutput>n</computeroutput>) for scalar types; linear for other types. </para>
</formalpara>
<note><para>This method has been specially designed for types which do not require an explicit destructruction (e.g. integer, float or a pointer). For these scalar types a call to a destructor is not required which makes it possible to implement the "erase from beginning" operation with a constant complexity. For non-sacalar types the complexity is linear (hence the explicit destruction is needed) and the implementation is actually equivalent to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f">rerase(begin(), begin() + n)</link></computeroutput>. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab6d4ae77d7445f844e30e78592f1e06f">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7485ee7f58b01363170114f2123a48d7">erase_end(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>n &lt;= <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput> </para>
</requires><postconditions><para>The <computeroutput>n</computeroutput> elements at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be removed. </para>
</postconditions><throws><simpara><classname>&lt;a</classname> href="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t"&gt;Exceptions of move_if_noexcept(T&amp;). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7485ee7f58b01363170114f2123a48d7" name="erase_end"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements to be removed. </para></description></parameter><purpose>Remove last <computeroutput>n</computeroutput> elements (with constant complexity for scalar types). </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic; no-throw if the operation in the <emphasis>Throws</emphasis> section does not throw anything. (I.e. no throw in case of scalars.) </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates iterators pointing to the last <computeroutput>n</computeroutput> erased elements. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in <computeroutput>n</computeroutput>) for scalar types; linear for other types. </para>
</formalpara>
<note><para>This method has been specially designed for types which do not require an explicit destructruction (e.g. integer, float or a pointer). For these scalar types a call to a destructor is not required which makes it possible to implement the "erase from end" operation with a constant complexity. For non-sacalar types the complexity is linear (hence the explicit destruction is needed) and the implementation is actually equivalent to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(end() - n, end())</link></computeroutput>. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab6d4ae77d7445f844e30e78592f1e06f">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab25d379cf66ace025036a47ddb344abd">erase_begin(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>n &lt;= <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput> </para>
</requires><postconditions><para>The <computeroutput>n</computeroutput> elements at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> will be removed. </para>
</postconditions><throws><simpara><classname>&lt;a</classname> href="circular_buffer/implementation.html#circular_buffer.implementation.exceptions_of_move_if_noexcept_t"&gt;Exceptions of move_if_noexcept(T&amp;). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a5d8e0c63975ce4e2428a9e20361110d4" name="clear" cv="noexcept"><type>void</type><purpose>Remove all stored elements from the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>) for scalar types; linear for other types. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a2d5b47d69b70eacfa7aa5377ad265d54">~circular_buffer()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a97155de712db1759e1698455b49a0be3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa96415389509a18bd7d7b5d8e4dda9bd">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab6d4ae77d7445f844e30e78592f1e06f">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab0f98ae303584ded5397f067bbfc911f">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ab25d379cf66ace025036a47ddb344abd">erase_begin(size_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a7485ee7f58b01363170114f2123a48d7">erase_end(size_type)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == 0</computeroutput> </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
</method-group>
</class><function id="doxygen.boost_circular_buffer_c___reference.base_8hpp_1ab095b425dfd8016226c738e49c14cba0" name="operator=="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><purpose>Compare two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s element-by-element to determine if they are equal. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s). </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
</para></description><returns><para><computeroutput>lhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == rhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &amp;&amp; <ulink url="https://www.boost.org/sgi/stl/equal.html">std::equal</ulink>(lhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>, lhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link>, rhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>)</computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></function>
<function id="doxygen.boost_circular_buffer_c___reference.base_8hpp_1a309dc3131ac371c77b341b46c0f3bf28" name="operator&lt;"><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><purpose>Compare two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s element-by-element to determine if the left one is lesser than the right one. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s). </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
</para></description><returns><para><computeroutput><ulink url="https://www.boost.org/sgi/stl/lexicographical_compare.html">std::lexicographical_compare</ulink>(lhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>, lhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link>, rhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>, rhs.<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link>)</computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></function>
<function id="doxygen.boost_circular_buffer_c___reference.base_8hpp_1aeb2e95f940a25dad306e40e3e42c9d1e" name="operator!="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><purpose>Compare two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s element-by-element to determine if they are non-equal. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s). </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput>operator==(const circular_buffer&lt;T,Alloc&gt;&amp;, const circular_buffer&lt;T,Alloc&gt;&amp;)</computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>!(lhs == rhs)</computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></function>
<function id="doxygen.boost_circular_buffer_c___reference.base_8hpp_1a1701c134cab157c6ceb4699edfcf99db" name="operator&gt;"><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><purpose>Compare two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s element-by-element to determine if the left one is greater than the right one. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s). </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput>operator&lt;(const circular_buffer&lt;T,Alloc&gt;&amp;, const circular_buffer&lt;T,Alloc&gt;&amp;)</computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>rhs &lt; lhs</computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></function>
<function id="doxygen.boost_circular_buffer_c___reference.base_8hpp_1a44b1f28ab2a47b4d500da75574d0d988" name="operator&lt;="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><purpose>Compare two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s element-by-element to determine if the left one is lesser or equal to the right one. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s). </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput>operator&lt;(const circular_buffer&lt;T,Alloc&gt;&amp;, const circular_buffer&lt;T,Alloc&gt;&amp;)</computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>!(rhs &lt; lhs)</computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></function>
<function id="doxygen.boost_circular_buffer_c___reference.base_8hpp_1a294628f7894ace1d50f3b2a227b155c4" name="operator&gt;="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to compare. </para></description></parameter><purpose>Compare two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s element-by-element to determine if the left one is greater or equal to the right one. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s). </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput>operator&lt;(const circular_buffer&lt;T,Alloc&gt;&amp;, const circular_buffer&lt;T,Alloc&gt;&amp;)</computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>!(lhs &lt; rhs)</computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></function>
<function id="doxygen.boost_circular_buffer_c___reference.base_8hpp_1a3f0eb1ea2997575395414c96401ad3f1" name="swap"><type>void</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype><classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> whose content will be swapped with <computeroutput>rhs</computeroutput>. </para></description></parameter><parameter name="rhs"><paramtype><classname>circular_buffer</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> whose content will be swapped with <computeroutput>lhs</computeroutput>. </para></description></parameter><purpose>Swap the contents of two <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s. </purpose><description><para>


<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s). </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators of both <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>s. (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 <ulink url="#debug">Debug Support</ulink> off otherwise an assertion will report an error if such invalidated iterator is used.) </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a44f5c09565b40cf10c2159b33103373d">swap(circular_buffer&lt;T, Alloc&gt;&amp;)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput>lhs</computeroutput> contains elements of <computeroutput>rhs</computeroutput> and vice versa. </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></function>







</namespace>
</header>
<header id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp" name="boost/circular_buffer/space_optimized.hpp">
<namespace name="boost">
<class id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized" name="circular_buffer_space_optimized"><template>
      <template-type-parameter name="T"/>
      <template-type-parameter name="Alloc"/>
    </template><inherit access="private">boost::circular_buffer&lt; T, Alloc &gt;</inherit><purpose>Space optimized circular buffer container adaptor. <computeroutput>T</computeroutput> must be a copyable class or must have an noexcept move constructor and move assignment operator. </purpose><typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1230db5cfef38275c285aea57a067276" name="value_type"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::value_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acbe74c642609f7e9e3b1f30236191598" name="pointer"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::pointer</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9b5647fe0d1351534d919d444f79219c" name="const_pointer"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::const_pointer</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa0b9382fb965166920739a43819105b9" name="reference"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::reference</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a5e2a20f697f95a4a66fba23fd5f051b9" name="const_reference"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::const_reference</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aab44f6e82b791a2ca6fe4e2a824c7883" name="size_type"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::size_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a2283eaadf46ead9e3bdd08b1da8f875e" name="difference_type"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::difference_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9f9be2a0d0f121b50dba716229abda6c" name="allocator_type"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::allocator_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a54dff912d3f2746a2f1e35654d799744" name="const_iterator"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::const_iterator</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad62129b314a125d92aa4bcdd0d5448f2" name="iterator"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::iterator</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a61efdeeb3ae5d821bf5b9e71f1769116" name="const_reverse_iterator"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::const_reverse_iterator</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aaac918f1c5910a0e79d90778521ea69f" name="reverse_iterator"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::reverse_iterator</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a61b21c3fa54381d937d100b01aa8ee6f" name="array_range"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::array_range</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa71029e2ada1b3e0918f549dc9470acb" name="const_array_range"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::const_array_range</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aaf233dea947b6242d4372be27c5b66d8" name="param_value_type"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::param_value_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aecb14bc0149a5c3e01357058e6436c18" name="rvalue_type"><type><classname>circular_buffer</classname>&lt; T, Alloc &gt;::rvalue_type</type></typedef>
<typedef id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a933c430702644ca103c1657b807c32e4" name="capacity_type"><description><para>Capacity controller of the space optimized circular buffer.</para><para><formalpara><title>See Also:</title><para>capacity_control in details.hpp. </para>
</formalpara>
<computeroutput> class capacity_control<sbr/>
 {<sbr/>
 size_type m_capacity; // Available capacity.<sbr/>
 size_type m_min_capacity; // Minimum capacity.<sbr/>
 public:<sbr/>
 capacity_control(size_type capacity, size_type min_capacity = 0)<sbr/>
 : m_capacity(capacity), m_min_capacity(min_capacity)<sbr/>
 {};<sbr/>
 size_type capacity() const { return m_capacity; }<sbr/>
 size_type min_capacity() const { return m_min_capacity; }<sbr/>
 operator size_type() const { return m_capacity; }<sbr/>
 };<sbr/>
 </computeroutput> </para><para>Always <computeroutput>capacity &gt;= min_capacity</computeroutput>. </para><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link></computeroutput> represents the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> and the <computeroutput>min_capacity()</computeroutput> determines the minimal allocated size of its internal buffer. </para><para>The converting constructor of the <computeroutput>capacity_control</computeroutput> allows implicit conversion from <computeroutput>size_type</computeroutput>-like types which ensures compatibility of creating an instance of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> with other STL containers.</para><para>On the other hand the operator <computeroutput>size_type()</computeroutput> provides implicit conversion to the <computeroutput>size_type</computeroutput> which allows to treat the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> the same way as in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para></description><type>cb_details::capacity_control&lt; size_type &gt;</type></typedef>
<method-group name="public member functions">
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affedf30e9a331120b7935bd43bcd96c9" name="full" cv="const noexcept"><type>bool</type><purpose>Is the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> full? </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a12c932f15d9028d99dd87ae890e60088">empty()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput>true</computeroutput> if the number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> equals the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>; <computeroutput>false</computeroutput> otherwise. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f" name="reserve" cv="const noexcept"><type>size_type</type><purpose>Get the maximum number of elements which can be inserted into the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> without overwriting any of already stored elements. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac7f5acdb90f95aabcdd81be2a9258dc4">max_size()</link></computeroutput> </para>
</formalpara>
</para></description><returns><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput> </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7" name="capacity" cv="const noexcept"><type>const capacity_type &amp;</type><purpose>Get the capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Does not invalidate any iterators. </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ac7f5acdb90f95aabcdd81be2a9258dc4">max_size()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a49f28bc5b33d2062b9f6a33b48264e3f">set_capacity(const capacity_type&amp;)</link></computeroutput> </para>
</formalpara>
</para></description><returns><para>The capacity controller representing the maximum number of elements which can be stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> and the minimal allocated size of the internal buffer. </para>
</returns><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a49f28bc5b33d2062b9f6a33b48264e3f" name="set_capacity"><type>void</type><parameter name="capacity_ctrl"><paramtype>const capacity_type &amp;</paramtype><description><para>The new capacity controller. </para></description></parameter><purpose>Change the capacity (and the minimal guaranteed amount of allocated memory) of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link>, capacity_ctrl.capacity()]</computeroutput>). </para>
</formalpara>
<note><para>To explicitly clear the extra allocated memory use the <emphasis role="bold">shrink-to-fit</emphasis> technique:<sbr/>
<sbr/>
 <computeroutput>boost::circular_buffer_space_optimized&lt;int&gt; cb(1000);<sbr/>
 ...<sbr/>
 boost::circular_buffer_space_optimized&lt;int&gt;(cb).swap(cb);</computeroutput><sbr/>
<sbr/>
 For more information about the shrink-to-fit technique in STL see <ulink url="http://www.gotw.ca/gotw/054.htm">http://www.gotw.ca/gotw/054.htm</ulink>. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a0f096c108ebde69ae83a9de41b3bea56">rset_capacity(const capacity_type&amp;)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1af244ff5576b79f8d60e273c02d71c9f2">resize(size_type, const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= capacity_ctrl.capacity()</computeroutput><sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is greater than the desired new capacity then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - capacity_ctrl.capacity()]</computeroutput> <emphasis role="bold">last</emphasis> elements will be removed and the new size will be equal to <computeroutput>capacity_ctrl.capacity()</computeroutput>.<sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> 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 <computeroutput>capacity_ctrl.min_capacity()</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted, (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1af244ff5576b79f8d60e273c02d71c9f2" name="resize"><type>void</type><parameter name="new_size"><paramtype>size_type</paramtype><description><para>The new size. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><default>value_type()</default><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with in order to gain the requested size. (See the <emphasis>Effect</emphasis>.) </para></description></parameter><purpose>Change the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the new size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad45e2e72d9e3fb42e090ebc47ac8d7ee">rresize(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a49f28bc5b33d2062b9f6a33b48264e3f">set_capacity(const capacity_type&amp;)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == new_size &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt;= new_size</computeroutput><sbr/>
<sbr/>
 If the new size is greater than the current size, copies of <computeroutput>item</computeroutput> will be inserted at the <emphasis role="bold">back</emphasis> of the of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to <computeroutput>new_size</computeroutput>.<sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is greater than the desired new size then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - new_size]</computeroutput> <emphasis role="bold">last</emphasis> elements will be removed. (The capacity will remain unchanged.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be accommodated as necessary. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a0f096c108ebde69ae83a9de41b3bea56" name="rset_capacity"><type>void</type><parameter name="capacity_ctrl"><paramtype>const capacity_type &amp;</paramtype><description><para>The new capacity controller. </para></description></parameter><purpose>Change the capacity (and the minimal guaranteed amount of allocated memory) of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link>, capacity_ctrl.capacity()]</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a49f28bc5b33d2062b9f6a33b48264e3f">set_capacity(const capacity_type&amp;)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad45e2e72d9e3fb42e090ebc47ac8d7ee">rresize(size_type, const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= capacity_ctrl</computeroutput><sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is greater than the desired new capacity then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - capacity_ctrl.capacity()]</computeroutput> <emphasis role="bold">first</emphasis> elements will be removed and the new size will be equal to <computeroutput>capacity_ctrl.capacity()</computeroutput>.<sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> 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 <computeroutput>capacity_ctrl.min_capacity()</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad45e2e72d9e3fb42e090ebc47ac8d7ee" name="rresize"><type>void</type><parameter name="new_size"><paramtype>size_type</paramtype><description><para>The new size. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><default>value_type()</default><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with in order to gain the requested size. (See the <emphasis>Effect</emphasis>.) </para></description></parameter><purpose>Change the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the new size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1af244ff5576b79f8d60e273c02d71c9f2">resize(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a0f096c108ebde69ae83a9de41b3bea56">rset_capacity(const capacity_type&amp;)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == new_size &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt;= new_size</computeroutput><sbr/>
<sbr/>
 If the new size is greater than the current size, copies of <computeroutput>item</computeroutput> will be inserted at the <emphasis role="bold">front</emphasis> of the of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to <computeroutput>new_size</computeroutput>.<sbr/>
<sbr/>
 If the current number of elements stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is greater than the desired new size then number of <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> - new_size]</computeroutput> <emphasis role="bold">first</emphasis> elements will be removed. (The capacity will remain unchanged.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be accommodated as necessary. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a8077e430e110ee99f5997257f33d0058" specifiers="explicit" cv="noexcept"><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create an empty space optimized circular buffer with zero capacity. </purpose><description><para>


<formalpara><title>Complexity</title><para>Constant. </para>
</formalpara>
<warning><para>Since Boost version 1.36 the behaviour of this constructor has changed. Now it creates a space optimized circular buffer with zero capacity. </para>
</warning>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() == 0 &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.min_capacity() == 0 &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == 0</computeroutput> </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a741159a0511a4e0fed6eaab6d6959fa7" specifiers="explicit"><parameter name="capacity_ctrl"><paramtype>capacity_type</paramtype><description><para>The capacity controller representing the maximum number of elements which can be stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> and the minimal allocated size of the internal buffer. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create an empty space optimized circular buffer with the specified capacity. </purpose><description><para>


<formalpara><title>Complexity</title><para>Constant. </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == 0</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>capacity_ctrl.min_capacity()</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1af8c9fa872f9a84d454d7e245cc2eadbd"><parameter name="capacity_ctrl"><paramtype>capacity_type</paramtype><description><para>The capacity controller representing the maximum number of elements which can be stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> and the minimal allocated size of the internal buffer. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create a full space optimized circular buffer with the specified capacity filled with <computeroutput>capacity_ctrl.capacity()</computeroutput> copies of <computeroutput>item</computeroutput>. </purpose><description><para>


<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>capacity_ctrl.capacity()</computeroutput>). </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affedf30e9a331120b7935bd43bcd96c9">full()</link> &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this) [capacity_ctrl.capacity() - 1] == item </computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>capacity_ctrl.capacity()</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
<simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad29ce80b10d4a3250fedeb9427210d96"><parameter name="capacity_ctrl"><paramtype>capacity_type</paramtype><description><para>The capacity controller representing the maximum number of elements which can be stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> and the minimal allocated size of the internal buffer. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the created <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create a space optimized circular buffer with the specified capacity filled with <computeroutput>n</computeroutput> copies of <computeroutput>item</computeroutput>. </purpose><description><para>



<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>n</computeroutput>). </para>
</formalpara>
</para></description><requires><para><computeroutput>capacity_ctrl.capacity() &gt;= n</computeroutput> </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == n &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this)[n - 1] == item</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>max[n, capacity_ctrl.min_capacity()]</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad9f273c1a794f84484d220e977a3e24b"><parameter name="cb"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> to be copied. </para></description></parameter><purpose>The copy constructor. </purpose><description><para>Creates a copy of the specified <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>. 


<formalpara><title>Complexity</title><para>Linear (in the size of <computeroutput>cb</computeroutput>). </para>
</formalpara>
</para></description><postconditions><para><computeroutput>*this == cb</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>cb.size()</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad0cc9be3b639bf97ba2673a19862a98e" cv="noexcept"><parameter name="cb"><paramtype><classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;&amp;</paramtype><description><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to 'steal' value from. </para></description></parameter><purpose>The move constructor. </purpose><description><para>Move constructs a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> from <computeroutput>cb</computeroutput>, leaving <computeroutput>cb</computeroutput> empty. 



<formalpara><title>Constant.</title><para/>
</formalpara>
</para></description><requires><para>C++ compiler with rvalue references support. </para>
</requires><postconditions><para><computeroutput>cb.empty()</computeroutput> </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1afa6f32d074d996d367dbe7cd2c614ca2"><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>Create a full space optimized circular buffer filled with a copy of the range. </purpose><description><para>



<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>std::distance(first, last)</computeroutput>). </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() == std::distance(first, last) &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.min_capacity() == 0 &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affedf30e9a331120b7935bd43bcd96c9">full()</link> &amp;&amp; (*this)[0]== *first &amp;&amp; (*this)[1] == *(first + 1) &amp;&amp; ... &amp;&amp; (*this)[std::distance(first, last) - 1] == *(last - 1)</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>std::distance(first, last)</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept and <computeroutput>InputIterator</computeroutput> is a move iterator. </simpara>
</throws></constructor>
<constructor id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a12a2c10a16b69388b782d71130f00625"><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="capacity_ctrl"><paramtype>capacity_type</paramtype><description><para>The capacity controller representing the maximum number of elements which can be stored in the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> and the minimal allocated size of the internal buffer. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><parameter name="alloc"><paramtype>const allocator_type &amp;</paramtype><default>allocator_type()</default><description><para>The allocator. </para></description></parameter><purpose>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. </purpose><description><para>



<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(first, last)</computeroutput>; in <computeroutput>min[capacity_ctrl.capacity(), std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= std::distance(first, last) &amp;&amp; (*this)[0]== (last - capacity_ctrl.capacity()) &amp;&amp; (*this)[1] == *(last - capacity_ctrl.capacity() + 1) &amp;&amp; ... &amp;&amp; (*this)[capacity_ctrl.capacity() - 1] == *(last - 1)</computeroutput><sbr/>
<sbr/>
 If the number of items to be copied from the range <computeroutput>[first, last)</computeroutput> is greater than the specified <computeroutput>capacity_ctrl.capacity()</computeroutput> then only elements from the range <computeroutput>[last - capacity_ctrl.capacity(), last)</computeroutput> will be copied.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>max[capacity_ctrl.min_capacity(), min[capacity_ctrl.capacity(), std::distance(first, last)]]</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></constructor>
<copy-assignment id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a72835f782ed2acda4074dff75f198373"><type><classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</type><parameter name="cb"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> to be copied. </para></description></parameter><purpose>The assign operator. </purpose><description><para>Makes this <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> to become a copy of the specified <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>. 


<formalpara><title>Exception Safety</title><para>Strong. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to this <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of <computeroutput>cb</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7ca4fda9526d0dad99706763c3b2d9f1">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a108055ae3f6b1635e1428b0455902cbf">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a14a79fa079775d0c6fefe6ed3bb34d5f">assign(InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7eaa049f1b889de9194cbe6419e90bbd">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput>*this == cb</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>cb.size()</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
<simpara><classname>Whatever</classname> <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></copy-assignment>
<copy-assignment id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a86e286b7527809dbd2c6e0449aab4f64" cv="noexcept"><type><classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</type><parameter name="cb"><paramtype><classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;&amp;</paramtype><description><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput> to 'steal' value from. </para></description></parameter><purpose>Move assigns content of <computeroutput>cb</computeroutput> to <computeroutput>*this</computeroutput>, leaving <computeroutput>cb</computeroutput> empty. </purpose><description><para>



<formalpara><title>Complexity</title><para>Constant. </para>
</formalpara>
</para></description><requires><para>C++ compiler with rvalue references support. </para>
</requires><postconditions><para><computeroutput>cb.empty()</computeroutput> </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></copy-assignment>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7ca4fda9526d0dad99706763c3b2d9f1" name="assign"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with. </para></description></parameter><purpose>Assign <computeroutput>n</computeroutput> items into the space optimized circular buffer. </purpose><description><para>The content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be removed and replaced with <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput>. 


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>n</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a72835f782ed2acda4074dff75f198373">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a108055ae3f6b1635e1428b0455902cbf">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a14a79fa079775d0c6fefe6ed3bb34d5f">assign(InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7eaa049f1b889de9194cbe6419e90bbd">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() == n &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.min_capacity() == 0 &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == n &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this) [n - 1] == item</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>n</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a108055ae3f6b1635e1428b0455902cbf" name="assign"><type>void</type><parameter name="capacity_ctrl"><paramtype>capacity_type</paramtype><description><para>The new capacity controller. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of elements the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be filled with. </para></description></parameter><purpose>Assign <computeroutput>n</computeroutput> items into the space optimized circular buffer specifying the capacity. </purpose><description><para>The capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be set to the specified value and the content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be removed and replaced with <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput>. 



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>n</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a72835f782ed2acda4074dff75f198373">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7ca4fda9526d0dad99706763c3b2d9f1">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a14a79fa079775d0c6fefe6ed3bb34d5f">assign(InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7eaa049f1b889de9194cbe6419e90bbd">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>capacity_ctrl.capacity() &gt;= n</computeroutput> </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == n &amp;&amp; (*this)[0] == item &amp;&amp; (*this)[1] == item &amp;&amp; ... &amp;&amp; (*this) [n - 1] == item </computeroutput><sbr/>
<sbr/>
 The amount of allocated memory will be <computeroutput>max[n, capacity_ctrl.min_capacity()]</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a14a79fa079775d0c6fefe6ed3bb34d5f" name="assign"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><purpose>Assign a copy of the range into the space optimized circular buffer. </purpose><description><para>The content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be removed and replaced with copies of elements from the specified range. 



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the <computeroutput>std::distance(first, last)</computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a72835f782ed2acda4074dff75f198373">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7ca4fda9526d0dad99706763c3b2d9f1">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a108055ae3f6b1635e1428b0455902cbf">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7eaa049f1b889de9194cbe6419e90bbd">assign(capacity_type, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() == std::distance(first, last) &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.min_capacity() == 0 &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == std::distance(first, last) &amp;&amp; (*this)[0]== *first &amp;&amp; (*this)[1] == *(first + 1) &amp;&amp; ... &amp;&amp; (*this)[std::distance(first, last) - 1] == *(last - 1)</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>std::distance(first, last)</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept and <computeroutput>InputIterator</computeroutput> is a move iterator. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7eaa049f1b889de9194cbe6419e90bbd" name="assign"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="capacity_ctrl"><paramtype>capacity_type</paramtype><description><para>The new capacity controller. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be copied. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be copied. </para></description></parameter><purpose>Assign a copy of the range into the space optimized circular buffer specifying the capacity. </purpose><description><para>The capacity of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be set to the specified value and the content of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> will be removed and replaced with copies of elements from the specified range. 



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>std::distance(first, last)</computeroutput>; in <computeroutput>min[capacity_ctrl.capacity(), std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a72835f782ed2acda4074dff75f198373">operator=</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a7ca4fda9526d0dad99706763c3b2d9f1">assign(size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a108055ae3f6b1635e1428b0455902cbf">assign(capacity_type, size_type, const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a14a79fa079775d0c6fefe6ed3bb34d5f">assign(InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>.<sbr/>
 <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> have to meet the requirements of <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link> == capacity_ctrl &amp;&amp; <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> &lt;= std::distance(first, last) &amp;&amp; (*this)[0]== *(last - capacity) &amp;&amp; (*this)[1] == *(last - capacity + 1) &amp;&amp; ... &amp;&amp; (*this)[capacity - 1] == *(last - 1)</computeroutput><sbr/>
<sbr/>
 If the number of items to be copied from the range <computeroutput>[first, last)</computeroutput> is greater than the specified <computeroutput>capacity</computeroutput> then only elements from the range <computeroutput>[last - capacity, last)</computeroutput> will be copied.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer is <computeroutput>max[std::distance(first, last), capacity_ctrl.min_capacity()]</computeroutput>. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept and <computeroutput>InputIterator</computeroutput> is a move iterator. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a4445d7daeeca1945880d45183217d53a" name="swap" cv="noexcept"><type>void</type><parameter name="cb"><paramtype><classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype><description><para>The <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> whose content will be swapped. </para></description></parameter><purpose>Swap the contents of two space-optimized circular-buffers. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>No-throw. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators of both <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> 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, otherwise an assertion will report an error if such invalidated iterator is used.) </para>
</formalpara>
<formalpara><title>Complexity</title><para>Constant (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput>swap(circular_buffer&lt;T, Alloc&gt;&amp;, circular_buffer&lt;T, Alloc&gt;&amp;)</computeroutput>, <computeroutput>swap(circular_buffer_space_optimized&lt;T, Alloc&gt;&amp;, circular_buffer_space_optimized&lt;T, Alloc&gt;&amp;)</computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput>this</computeroutput> contains elements of <computeroutput>cb</computeroutput> and vice versa; the capacity and the amount of allocated memory in the internal buffer of <computeroutput>this</computeroutput> equal to the capacity and the amount of allocated memory of <computeroutput>cb</computeroutput> and vice versa. </para>
</postconditions><throws><simpara><classname>Nothing.</classname> </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a741062e21307061dc8d75e9189c0f592" name="push_back"><type>void</type><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the end of the space optimized circular buffer. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a05fc4b8702090590a2444745f7e1fd35">push_front(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a">back()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the first element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a43136bdd6c7a7856e2e6b09c87a4e451" name="push_back"><type>void</type><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the end of the space optimized circular buffer. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a05fc4b8702090590a2444745f7e1fd35">push_front(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a">back()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the first element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acb45532bece8fb04940e38005be341a8" name="push_back"><type>void</type><purpose>Insert a new element at the end of the space optimized circular buffer. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a05fc4b8702090590a2444745f7e1fd35">push_front(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1ad985d974020f88bb4255d8edbae0a30a">back()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the first element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acd85b7f08f1d7b99c40b898cff5116d4" name="push_front"><type>void</type><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the beginning of the space optimized circular buffer. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acb45532bece8fb04940e38005be341a8">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f">front()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the last element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a03d43a8671be070303083a954f172dad" name="push_front"><type>void</type><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert a new element at the beginning of the space optimized circular buffer. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acb45532bece8fb04940e38005be341a8">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f">front()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the last element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a05fc4b8702090590a2444745f7e1fd35" name="push_front"><type>void</type><purpose>Insert a new element at the beginning of the space optimized circular buffer. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acb45532bece8fb04940e38005be341a8">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788">pop_front()</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para>if <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity() &gt; 0</computeroutput> then <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a0d5fdeabeb352f47d1f7bb1ea8d9819f">front()</link> == item</computeroutput><sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the last element will be removed. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6" name="pop_back"><type>void</type><purpose>Remove the last element from the space optimized circular buffer. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788">pop_front()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acb45532bece8fb04940e38005be341a8">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a05fc4b8702090590a2444745f7e1fd35">push_front(const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><postconditions><para>The last element is removed from the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively decreased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ad7d496c40fc053258ac7d19cf5261788" name="pop_front"><type>void</type><purpose>Remove the first element from the space optimized circular buffer. </purpose><description><para>


<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9c4290c18ab3dd2462dc01fb8368dff6">pop_back()</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1acb45532bece8fb04940e38005be341a8">push_back(const_reference)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a05fc4b8702090590a2444745f7e1fd35">push_front(const_reference)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>!empty()</computeroutput> </para>
</requires><postconditions><para>The first element is removed from the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively decreased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa" name="insert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the first element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ac05b6756df1a0c5514a70453cd9b551b" name="insert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the first element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a8e4ffef2a8d965f75c2a85dacbc3c327" name="insert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><purpose>Insert an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the first element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b" name="insert"><type>void</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput>s will be inserted. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of <computeroutput>item</computeroutput>s the to be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element whose copies will be inserted. </para></description></parameter><purpose>Insert <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput> at the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity(), <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> + n]</computeroutput>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting 5 elements at the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>insert(p, (size_t)5, 0);</computeroutput><sbr/>
<sbr/>
actually only 4 elements get inserted and elements <computeroutput>1</computeroutput> and <computeroutput>2</computeroutput> are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|0|0|0|0|3|4|</computeroutput><sbr/>
 <sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|0|0|0|0|0|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The number of <computeroutput>min[n, (pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>) + <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>]</computeroutput> elements will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>, max[0, n - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>]]</computeroutput> elements will be overwritten at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92" name="insert"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the range will be inserted. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be inserted. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be inserted. </para></description></parameter><purpose>Insert the range <computeroutput>[first, last)</computeroutput> at the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> + std::distance(first, last)]</computeroutput>; in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity(), <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> + std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting a range of elements at the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>int array[] = { 5, 6, 7, 8, 9 };</computeroutput><sbr/>
<computeroutput>insert(p, array, array + 5);</computeroutput><sbr/>
<sbr/>
 actually only elements <computeroutput>6</computeroutput>, <computeroutput>7</computeroutput>, <computeroutput>8</computeroutput> and <computeroutput>9</computeroutput> from the specified range get inserted and elements <computeroutput>1</computeroutput> and <computeroutput>2</computeroutput> are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|6|7|8|9|3|4|</computeroutput><sbr/>
<sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|5|6|7|8|9|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end.<sbr/>
Valid range <computeroutput>[first, last)</computeroutput> where <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> meet the requirements of an <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para>Elements from the range <computeroutput>[first + max[0, distance(first, last) - (pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>], last)</computeroutput> will be inserted at the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[pos - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link>, max[0, distance(first, last) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>]]</computeroutput> elements will be overwritten at the beginning of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2" name="rinsert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position before which the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element before the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the last element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a6b226205a56f026c7321acecf622f2e3" name="rinsert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position before which the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><parameter name="item"><paramtype>rvalue_type</paramtype><description><para>The element to be inserted. </para></description></parameter><purpose>Insert an element before the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the last element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a55d78f0c560014f7b38776a24e832c3e" name="rinsert"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position before which the <computeroutput>item</computeroutput> will be inserted. </para></description></parameter><purpose>Insert an element before the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The <computeroutput>item</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
 If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full, the last element will be overwritten. If the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> is full and the <computeroutput>pos</computeroutput> points to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>, then the <computeroutput>item</computeroutput> will not be inserted. If the capacity is <computeroutput>0</computeroutput>, nothing will be inserted.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><returns><para>Iterator to the inserted element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if the <computeroutput>item</computeroutput> is not inserted. (See the <emphasis>Effect</emphasis>.) </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T()</computeroutput> throws. Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::T(T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d" name="rinsert"><type>void</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the <computeroutput>item</computeroutput>s will be inserted. </para></description></parameter><parameter name="n"><paramtype>size_type</paramtype><description><para>The number of <computeroutput>item</computeroutput>s the to be inserted. </para></description></parameter><parameter name="item"><paramtype>param_value_type</paramtype><description><para>The element whose copies will be inserted. </para></description></parameter><purpose>Insert <computeroutput>n</computeroutput> copies of the <computeroutput>item</computeroutput> before the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity(), <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> + n]</computeroutput>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting 5 elements before the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>rinsert(p, (size_t)5, 0);</computeroutput><sbr/>
<sbr/>
actually only 4 elements get inserted and elements <computeroutput>3</computeroutput> and <computeroutput>4</computeroutput> are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|1|2|0|0|0|0|</computeroutput><sbr/>
 <sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|0|0|0|0|0|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c">rinsert(iterator, InputIterator, InputIterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end. </para>
</requires><postconditions><para>The number of <computeroutput>min[n, (<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos) + <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>]</computeroutput> elements will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos, max[0, n - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>]]</computeroutput> elements will be overwritten at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a689b81ea66407b95a20726a141feb54c" name="rinsert"><type>void</type><template>
          <template-type-parameter name="InputIterator"/>
        </template><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator specifying the position where the range will be inserted. </para></description></parameter><parameter name="first"><paramtype>InputIterator</paramtype><description><para>The beginning of the range to be inserted. </para></description></parameter><parameter name="last"><paramtype>InputIterator</paramtype><description><para>The end of the range to be inserted. </para></description></parameter><purpose>Insert the range <computeroutput>[first, last)</computeroutput> before the specified position. </purpose><description><para>



<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in <computeroutput>[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> + std::distance(first, last)]</computeroutput>; in <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a02126fefb68c4edaff62e3c47adf59d7">capacity()</link>.capacity(), <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> + std::distance(first, last)]</computeroutput> if the <computeroutput>InputIterator</computeroutput> is a <ulink url="https://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator</ulink>). </para>
</formalpara>
<formalpara><title>Example</title><para>Consider a <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.<sbr/>
<sbr/>
 <computeroutput>|1|2|3|4| | |</computeroutput><sbr/>
 <computeroutput>p ___^</computeroutput><sbr/>
<sbr/>
After inserting a range of elements before the position <computeroutput>p</computeroutput>:<sbr/>
<sbr/>
 <computeroutput>int array[] = { 5, 6, 7, 8, 9 };</computeroutput><sbr/>
<computeroutput>insert(p, array, array + 5);</computeroutput><sbr/>
<sbr/>
 actually only elements <computeroutput>5</computeroutput>, <computeroutput>6</computeroutput>, <computeroutput>7</computeroutput> and <computeroutput>8</computeroutput> from the specified range get inserted and elements <computeroutput>3</computeroutput> and <computeroutput>4</computeroutput> are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:<sbr/>
<sbr/>
<computeroutput>|1|2|5|6|7|8|</computeroutput><sbr/>
<sbr/>
For comparison if the capacity would not be preserved the internal buffer would then result in <computeroutput>|1|2|5|6|7|8|9|3|4|</computeroutput>. </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1affdfa9cdfa6f42ff67d8b463bc5af1f2">rinsert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1ab4a56a420d75236091bdeddb1b1224aa">insert(iterator, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1adc2060ce1105d80429ff3f004ca0691b">insert(iterator, size_type, value_type)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1aa981fae21385a0210ea69ce4a4cb7b92">insert(iterator, InputIterator, InputIterator)</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> or its end.<sbr/>
 Valid range <computeroutput>[first, last)</computeroutput> where <computeroutput>first</computeroutput> and <computeroutput>last</computeroutput> meet the requirements of an <ulink url="https://www.boost.org/sgi/stl/InputIterator.html">InputIterator</ulink>. </para>
</requires><postconditions><para>Elements from the range <computeroutput>[first, last - max[0, distance(first, last) - (<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>])</computeroutput> will be inserted before the position <computeroutput>pos</computeroutput>.<sbr/>
The number of <computeroutput>min[<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link> - pos, max[0, distance(first, last) - <link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a1235f424313eb295ea327db53a44f66f">reserve()</link>]]</computeroutput> elements will be overwritten at the end of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>.<sbr/>
(See <emphasis>Example</emphasis> for the explanation.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively increased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::T(const T&amp;)</computeroutput> throws. Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a36feadef225bd8a10962a92c4ffcdfd3" name="erase"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator pointing at the element to be removed. </para></description></parameter><purpose>Remove an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9e9a4e0dfca27329da78e014d97201ca">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a6e96800422211d02621526c894b71fa1">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a54fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a2aa1dd29bd9509b5482ca2666c61deab">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (but not an <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</requires><postconditions><para>The element at the position <computeroutput>pos</computeroutput> is removed.<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively decreased. </para>
</postconditions><returns><para>Iterator to the first element remaining beyond the removed element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9e9a4e0dfca27329da78e014d97201ca" name="erase"><type>iterator</type><parameter name="first"><paramtype>iterator</paramtype><description><para>The beginning of the range to be removed. </para></description></parameter><parameter name="last"><paramtype>iterator</paramtype><description><para>The end of the range to be removed. </para></description></parameter><purpose>Erase the range <computeroutput>[first, last)</computeroutput>. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a36feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a6e96800422211d02621526c894b71fa1">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a54fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a2aa1dd29bd9509b5482ca2666c61deab">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>. </para>
</requires><postconditions><para>The elements from the range <computeroutput>[first, last)</computeroutput> are removed. (If <computeroutput>first == last</computeroutput> nothing is removed.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively decreased. </para>
</postconditions><returns><para>Iterator to the first element remaining beyond the removed elements or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a6e96800422211d02621526c894b71fa1" name="rerase"><type>iterator</type><parameter name="pos"><paramtype>iterator</paramtype><description><para>An iterator pointing at the element to be removed. </para></description></parameter><purpose>Remove an element at the specified position. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<note><para>Basically there is no difference between <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a36feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</link></computeroutput> and this method. It is implemented only for consistency with the base <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a36feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9e9a4e0dfca27329da78e014d97201ca">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a54fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a2aa1dd29bd9509b5482ca2666c61deab">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para><computeroutput>pos</computeroutput> is a valid iterator pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (but not an <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>).<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively decreased. </para>
</requires><postconditions><para>The element at the position <computeroutput>pos</computeroutput> is removed. </para>
</postconditions><returns><para>Iterator to the first element remaining in front of the removed element or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a54fd4c2a67c7d6de6cbf6c8255729e98" name="rerase"><type>iterator</type><parameter name="first"><paramtype>iterator</paramtype><description><para>The beginning of the range to be removed. </para></description></parameter><parameter name="last"><paramtype>iterator</paramtype><description><para>The end of the range to be removed. </para></description></parameter><purpose>Erase the range <computeroutput>[first, last)</computeroutput>. </purpose><description><para>




<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<note><para>Basically there is no difference between <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9e9a4e0dfca27329da78e014d97201ca">erase(iterator, iterator)</link></computeroutput> and this method. It is implemented only for consistency with the base <computeroutput>&lt;<link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer">circular_buffer</link></computeroutput>. </para>
</note>
<formalpara><title>See Also:</title><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a36feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9e9a4e0dfca27329da78e014d97201ca">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a6e96800422211d02621526c894b71fa1">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a2aa1dd29bd9509b5482ca2666c61deab">clear()</link></computeroutput> </para>
</formalpara>
</para></description><requires><para>Valid range <computeroutput>[first, last)</computeroutput>. </para>
</requires><postconditions><para>The elements from the range <computeroutput>[first, last)</computeroutput> are removed. (If <computeroutput>first == last</computeroutput> nothing is removed.)<sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively decreased. </para>
</postconditions><returns><para>Iterator to the first element remaining in front of the removed elements or <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1a3bf9f4a79d86ec4e2d79e98691364f11">begin()</link></computeroutput> if no such element exists. </para>
</returns><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). Whatever <computeroutput>T::operator = (const T&amp;)</computeroutput> throws or nothing if <computeroutput>T::operator = (T&amp;&amp;)</computeroutput> is noexcept. </simpara>
</throws></method>
<method id="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a2aa1dd29bd9509b5482ca2666c61deab" name="clear"><type>void</type><purpose>Remove all stored elements from the space optimized circular buffer. </purpose><description><para>

<formalpara><title>Exception Safety</title><para>Basic. </para>
</formalpara>
<formalpara><title>Iterator Invalidation</title><para>Invalidates all iterators pointing to the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput> (except iterators equal to <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1aa53a64c8b84961bb622ee0c5a4882554">end()</link></computeroutput>). </para>
</formalpara>
<formalpara><title>Complexity</title><para>Linear (in the size of the <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized">circular_buffer_space_optimized</link></computeroutput>). </para>
</formalpara>
<formalpara><title>See Also:</title><para><computeroutput>~circular_buffer_space_optimized()</computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a36feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a9e9a4e0dfca27329da78e014d97201ca">erase(iterator, iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a6e96800422211d02621526c894b71fa1">rerase(iterator)</link></computeroutput>, <computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer__space__optimized_1a54fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator, iterator)</link></computeroutput> </para>
</formalpara>
</para></description><postconditions><para><computeroutput><link linkend="doxygen.boost_circular_buffer_c___reference.classboost_1_1circular__buffer_1af051aec0ffeb9105419cf6292ba80750">size()</link> == 0</computeroutput><sbr/>
<sbr/>
 The amount of allocated memory in the internal buffer may be predictively decreased. </para>
</postconditions><throws><simpara><classname>An allocation error</classname> if memory is exhausted (<computeroutput>std::bad_alloc</computeroutput> if the standard allocator is used). </simpara>
</throws></method>
</method-group>
<method-group name="private static functions">
</method-group>
</class>






<function id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp_1ad7f054a3ce072badf665508b4dc203ff" name="operator=="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><purpose>Test two space optimized circular buffers for equality. </purpose></function>
<function id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp_1a243ee3c3efc2431146d233b11cbcf92c" name="operator&lt;"><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><purpose>Lexicographical comparison. </purpose></function>
<function id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp_1a30758ab4ed2357ecd64e77d865eaf065" name="operator!="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><purpose>Test two space optimized circular buffers for non-equality. </purpose></function>
<function id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp_1a8e04e4af9435a092ea68f42bada5c1a4" name="operator&gt;"><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><purpose>Lexicographical comparison. </purpose></function>
<function id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp_1a35f67bed871a70dc36b62378d513292f" name="operator&lt;="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><purpose>Lexicographical comparison. </purpose></function>
<function id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp_1a4582c33ceac67ba0308935519e08a20f" name="operator&gt;="><type>bool</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><parameter name="rhs"><paramtype>const <classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><purpose>Lexicographical comparison. </purpose></function>
<function id="doxygen.boost_circular_buffer_c___reference.space__optimized_8hpp_1a313f3cbad651ca23275bc1911b36b410" name="swap"><type>void</type><template>
          <template-type-parameter name="T"/>
          <template-type-parameter name="Alloc"/>
        </template><parameter name="lhs"><paramtype><classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><parameter name="rhs"><paramtype><classname>circular_buffer_space_optimized</classname>&lt; T, Alloc &gt; &amp;</paramtype></parameter><purpose>Swap the contents of two space optimized circular buffers. </purpose></function>
</namespace>
</header>
</library-reference>