class.boost.array.html 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template array</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.61.3"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="array.reference.html#header.boost.array.hpp" title="Header &lt;boost/array.hpp&gt;"><link rel="previous" href="array.reference.html" title="Reference"><link rel="next" href="array.rationale.html" title="Design Rationale"><link rel="chapter" href="libraries.html" title="The Boost C++ Libraries"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2383300-bb.html" title="Function any_cast"><link rel="chapter" href="array.html" title="Boost.Array"><link rel="refentry" href="class.boost.array.html" title="Class template array"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="class.boost.bad_function_call.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="class.boost.reference_wrapper.html" title="Class template reference_wrapper"><link rel="refentry" href="class.boost.is_reference_wrapper.html" title="Class template is_reference_wrapper"><link rel="refentry" href="class.boost.unwrap_reference.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="class.boost.signals.trackable.html" title="Class trackable"><link rel="refentry" href="class.boost.signals.connection.html" title="Class connection"><link rel="refentry" href="class.boost.signals.scoped_connection.html" title="Class scoped_connection"><link rel="refentry" href="id2532119-bb.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2354683-bb.html" title="Class last_value&lt;void&gt;"><link rel="chapter" href="variant.html" title="Boost.Variant"><link rel="refentry" href="BOOST_VARIANT_LIMIT_TYPES.html" title="Macro BOOST_VARIANT_LIMIT_TYPES"><link rel="refentry" href="BOOST_VARIANT_ENUM_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_PARAMS"><link rel="refentry" href="BOOST_VARIANT_ENUM_SHIFTED_PARAMS.html" title="Macro BOOST_VARIANT_ENUM_SHIFTED_PARAMS"><link rel="refentry" href="BOOST_VARIANT_NO_REFERENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_REFERENCE_SUPPORT"><link rel="refentry" href="BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT.html" title="Macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT"><link rel="refentry" href="BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT.html" title="Macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT"><link rel="refentry" href="class.boost.variant.html" title="Class template variant"><link rel="refentry" href="id2518553-bb.html" title="Function template swap"><link rel="refentry" href="id2524211-bb.html" title="Function template operator&lt;&lt;"><link rel="refentry" href="class.boost.make_variant_over.html" title="Class template make_variant_over"><link rel="refentry" href="class.boost.make_recursive_variant.html" title="Class template make_recursive_variant"><link rel="refentry" href="class.boost.make_recursive_variant_over.html" title="Class template make_recursive_variant_over"><link rel="refentry" href="class.boost.recursive_wrapper.html" title="Class template recursive_wrapper"><link rel="refentry" href="class.boost.is_recursive_wrapper.html" title="Class template is_recursive_wrapper"><link rel="refentry" href="class.boost.unwrap_recursive_wrapper.html" title="Class template unwrap_recursive_wrapper"><link rel="refentry" href="class.boost.apply_visitor_delayed_t.html" title="Class template apply_visitor_delayed_t"><link rel="refentry" href="id2557051-bb.html" title="Function apply_visitor"><link rel="refentry" href="class.boost.bad_get.html" title="Class bad_get"><link rel="refentry" href="id2493238-bb.html" title="Function get"><link rel="refentry" href="class.boost.bad_visit.html" title="Class bad_visit"><link rel="refentry" href="class.boost.static_visitor.html" title="Class template static_visitor"><link rel="refentry" href="class.boost.visitor_ptr_t.html" title="Class template visitor_ptr_t"><link rel="refentry" href="id2544445-bb.html" title="Function template visitor_ptr"><link rel="chapter" href="boostbook.html" title="The BoostBook Documentation Format"><link rel="refentry" href="boostbook.dtd.class-specialization.html" title="
  2. BoostBook element class-specialization"><link rel="refentry" href="boostbook.dtd.link-test.html" title="
  3. BoostBook element link-test"><link rel="refentry" href="boostbook.dtd.link-fail-test.html" title="
  4. BoostBook element link-fail-test"><link rel="refentry" href="boostbook.dtd.typedef.html" title="
  5. BoostBook element typedef"><link rel="refentry" href="boostbook.dtd.static-constant.html" title="
  6. BoostBook element static-constant"><link rel="refentry" href="boostbook.dtd.code.html" title="
  7. BoostBook element code"><link rel="refentry" href="boostbook.dtd.destructor.html" title="
  8. BoostBook element destructor"><link rel="refentry" href="boostbook.dtd.template-type-parameter.html" title="
  9. BoostBook element template-type-parameter"><link rel="refentry" href="boostbook.dtd.description.html" title="
  10. BoostBook element description"><link rel="refentry" href="boostbook.dtd.librarylist.html" title="
  11. BoostBook element librarylist"><link rel="refentry" href="boostbook.dtd.library-reference.html" title="
  12. BoostBook element library-reference"><link rel="refentry" href="boostbook.dtd.boostbook.html" title="
  13. BoostBook element boostbook"><link rel="refentry" href="boostbook.dtd.union.html" title="
  14. BoostBook element union"><link rel="refentry" href="boostbook.dtd.inherit.html" title="
  15. BoostBook element inherit"><link rel="refentry" href="boostbook.dtd.template-varargs.html" title="
  16. BoostBook element template-varargs"><link rel="refentry" href="boostbook.dtd.source.html" title="
  17. BoostBook element source"><link rel="refentry" href="boostbook.dtd.function.html" title="
  18. BoostBook element function"><link rel="refentry" href="boostbook.dtd.postconditions.html" title="
  19. BoostBook element postconditions"><link rel="refentry" href="boostbook.dtd.compile-test.html" title="
  20. BoostBook element compile-test"><link rel="refentry" href="boostbook.dtd.method.html" title="
  21. BoostBook element method"><link rel="refentry" href="boostbook.dtd.snippet.html" title="
  22. BoostBook element snippet"><link rel="refentry" href="boostbook.dtd.constructor.html" title="
  23. BoostBook element constructor"><link rel="refentry" href="boostbook.dtd.namespace.html" title="
  24. BoostBook element namespace"><link rel="refentry" href="boostbook.dtd.if-fails.html" title="
  25. BoostBook element if-fails"><link rel="refentry" href="boostbook.dtd.free-function-group.html" title="
  26. BoostBook element free-function-group"><link rel="refentry" href="boostbook.dtd.functionname.html" title="
  27. BoostBook element functionname"><link rel="refentry" href="boostbook.dtd.librarycategory.html" title="
  28. BoostBook element librarycategory"><link rel="refentry" href="boostbook.dtd.notes.html" title="
  29. BoostBook element notes"><link rel="refentry" href="boostbook.dtd.data-member.html" title="
  30. BoostBook element data-member"><link rel="refentry" href="boostbook.dtd.specialization.html" title="
  31. BoostBook element specialization"><link rel="refentry" href="boostbook.dtd.union-specialization.html" title="
  32. BoostBook element union-specialization"><link rel="refentry" href="boostbook.dtd.throws.html" title="
  33. BoostBook element throws"><link rel="refentry" href="boostbook.dtd.template-arg.html" title="
  34. BoostBook element template-arg"><link rel="refentry" href="boostbook.dtd.method-group.html" title="
  35. BoostBook element method-group"><link rel="refentry" href="boostbook.dtd.requirement.html" title="
  36. BoostBook element requirement"><link rel="refentry" href="boostbook.dtd.precondition.html" title="
  37. BoostBook element precondition"><link rel="refentry" href="boostbook.dtd.paramtype.html" title="
  38. BoostBook element paramtype"><link rel="refentry" href="boostbook.dtd.using-class.html" title="
  39. BoostBook element using-class"><link rel="refentry" href="boostbook.dtd.run-test.html" title="
  40. BoostBook element run-test"><link rel="refentry" href="boostbook.dtd.librarypurpose.html" title="
  41. BoostBook element librarypurpose"><link rel="refentry" href="boostbook.dtd.copy-assignment.html" title="
  42. BoostBook element copy-assignment"><link rel="refentry" href="boostbook.dtd.run-fail-test.html" title="
  43. BoostBook element run-fail-test"><link rel="refentry" href="boostbook.dtd.template.html" title="
  44. BoostBook element template"><link rel="refentry" href="boostbook.dtd.compile-fail-test.html" title="
  45. BoostBook element compile-fail-test"><link rel="refentry" href="boostbook.dtd.returns.html" title="
  46. BoostBook element returns"><link rel="refentry" href="boostbook.dtd.default.html" title="
  47. BoostBook element default"><link rel="refentry" href="boostbook.dtd.parameter.html" title="
  48. BoostBook element parameter"><link rel="refentry" href="boostbook.dtd.signature.html" title="
  49. BoostBook element signature"><link rel="refentry" href="boostbook.dtd.overloaded-function.html" title="
  50. BoostBook element overloaded-function"><link rel="refentry" href="boostbook.dtd.class.html" title="
  51. BoostBook element class"><link rel="refentry" href="boostbook.dtd.librarycategorydef.html" title="
  52. BoostBook element librarycategorydef"><link rel="refentry" href="boostbook.dtd.type.html" title="
  53. BoostBook element type"><link rel="refentry" href="boostbook.dtd.enumvalue.html" title="
  54. BoostBook element enumvalue"><link rel="refentry" href="boostbook.dtd.overloaded-method.html" title="
  55. BoostBook element overloaded-method"><link rel="refentry" href="boostbook.dtd.programlisting.html" title="
  56. BoostBook element programlisting"><link rel="refentry" href="boostbook.dtd.complexity.html" title="
  57. BoostBook element complexity"><link rel="refentry" href="boostbook.dtd.purpose.html" title="
  58. BoostBook element purpose"><link rel="refentry" href="boostbook.dtd.template-nontype-parameter.html" title="
  59. BoostBook element template-nontype-parameter"><link rel="refentry" href="boostbook.dtd.library.html" title="
  60. BoostBook element library"><link rel="refentry" href="boostbook.dtd.librarycategorylist.html" title="
  61. BoostBook element librarycategorylist"><link rel="refentry" href="boostbook.dtd.using-namespace.html" title="
  62. BoostBook element using-namespace"><link rel="refentry" href="boostbook.dtd.struct-specialization.html" title="
  63. BoostBook element struct-specialization"><link rel="refentry" href="boostbook.dtd.struct.html" title="
  64. BoostBook element struct"><link rel="refentry" href="boostbook.dtd.lib.html" title="
  65. BoostBook element lib"><link rel="refentry" href="boostbook.dtd.enum.html" title="
  66. BoostBook element enum"><link rel="refentry" href="boostbook.dtd.requires.html" title="
  67. BoostBook element requires"><link rel="refentry" href="boostbook.dtd.effects.html" title="
  68. BoostBook element effects"><link rel="refentry" href="boostbook.dtd.libraryname.html" title="
  69. BoostBook element libraryname"><link rel="refentry" href="boostbook.dtd.libraryinfo.html" title="
  70. BoostBook element libraryinfo"><link rel="refentry" href="boostbook.dtd.testsuite.html" title="
  71. BoostBook element testsuite"><link rel="refentry" href="boostbook.dtd.header.html" title="
  72. BoostBook element header"><link rel="refentry" href="boostbook.dtd.rationale.html" title="
  73. BoostBook element rationale"><link rel="refentry" href="Assignable.html" title="Concept Assignable"><link rel="refentry" href="InputIterator.html" title="Concept InputIterator"><link rel="refentry" href="OutputIterator.html" title="Concept OutputIterator"><link rel="refentry" href="ForwardIterator.html" title="Concept ForwardIterator"><link rel="refentry" href="BidirectionalIterator.html" title="Concept BidirectionalIterator"><link rel="refentry" href="RandomAccessIterator.html" title="Concept RandomAccessIterator"><link rel="refentry" href="DefaultConstructible.html" title="Concept DefaultConstructible"><link rel="refentry" href="CopyConstructible.html" title="Concept CopyConstructible"><link rel="refentry" href="EqualityComparable.html" title="Concept EqualityComparable"><link rel="refentry" href="LessThanComparable.html" title="Concept LessThanComparable"><link rel="refentry" href="SignedInteger.html" title="Concept SignedInteger"><link rel="section" href="class.boost.array.html#id2509052" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="libraries.html"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.array"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template array</span></h2><p>boost::array &#8212; STL compliant container wrapper for arrays of constant size</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  74. <span class="bold"><b>class</b></span> array {
  75. <span class="bold"><b>public</b></span>:
  76.   <span class="emphasis"><em>// types</em></span>
  77.   <span class="bold"><b>typedef</b></span> T                                     value_type;            
  78.   <span class="bold"><b>typedef</b></span> T*                                    iterator;              
  79.   <span class="bold"><b>typedef</b></span> <span class="bold"><b>const</b></span> T*                              const_iterator;        
  80.   <span class="bold"><b>typedef</b></span> std::reverse_iterator&lt;iterator&gt;       reverse_iterator;      
  81.   <span class="bold"><b>typedef</b></span> std::reverse_iterator&lt;const_iterator&gt; const_reverse_iterator;
  82.   <span class="bold"><b>typedef</b></span> T&amp;                                    reference;             
  83.   <span class="bold"><b>typedef</b></span> <span class="bold"><b>const</b></span> T&amp;                              const_reference;       
  84.   <span class="bold"><b>typedef</b></span> std::size_t                           size_type;             
  85.   <span class="bold"><b>typedef</b></span> std::ptrdiff_t                        difference_type;       
  86.   <span class="emphasis"><em>// static constants</em></span>
  87.   <span class="bold"><b>static</b></span> <span class="bold"><b>const</b></span> size_type static_size = N;
  88.   <span class="emphasis"><em>// <a href="class.boost.array.html#class.boost.arrayconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  89.   <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> U&gt; array&amp; <a href="class.boost.array.html#id2396652-bb"><span class="bold"><b>operator</b></span>=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;U, N&gt;&amp;);
  90.   <span class="emphasis"><em>// <a href="class.boost.array.html#id2396689-bb">iterator support</a></em></span>
  91.   <span class="type">iterator</span> <a href="class.boost.array.html#id2396698-bb">begin</a>();
  92.   <span class="type">const_iterator</span> <a href="class.boost.array.html#id2396704-bb">begin</a>() <span class="bold"><b>const</b></span>;
  93.   <span class="type">iterator</span> <a href="class.boost.array.html#id2396726-bb">end</a>();
  94.   <span class="type">const_iterator</span> <a href="class.boost.array.html#id2396733-bb">end</a>() <span class="bold"><b>const</b></span>;
  95.   <span class="emphasis"><em>// <a href="class.boost.array.html#id2396753-bb">reverse iterator support</a></em></span>
  96.   <span class="type">reverse_iterator</span> <a href="class.boost.array.html#id2396761-bb">rbegin</a>();
  97.   <span class="type">const_reverse_iterator</span> <a href="class.boost.array.html#id2396767-bb">rbegin</a>() <span class="bold"><b>const</b></span>;
  98.   <span class="type">reverse_iterator</span> <a href="class.boost.array.html#id2396786-bb">rend</a>();
  99.   <span class="type">const_reverse_iterator</span> <a href="class.boost.array.html#id2396793-bb">rend</a>() <span class="bold"><b>const</b></span>;
  100.   <span class="emphasis"><em>// <a href="class.boost.array.html#id2396809-bb">capacity</a></em></span>
  101.   <span class="type">size_type</span> <a href="class.boost.array.html#id2396813-bb">size</a>();
  102.   <span class="type"><span class="bold"><b>bool</b></span></span> <a href="class.boost.array.html#id2396827-bb">empty</a>();
  103.   <span class="type">size_type</span> <a href="class.boost.array.html#id2369584-bb">max_size</a>();
  104.   <span class="emphasis"><em>// <a href="class.boost.array.html#id2369602-bb">element access</a></em></span>
  105.   <span class="type">reference</span> <a href="class.boost.array.html#id2369610-bb"><span class="bold"><b>operator</b></span>[]</a>(size_type);
  106.   <span class="type">const_reference</span> <a href="class.boost.array.html#id2369625-bb"><span class="bold"><b>operator</b></span>[]</a>(size_type) <span class="bold"><b>const</b></span>;
  107.   <span class="type">reference</span> <a href="class.boost.array.html#id2369663-bb">at</a>(size_type);
  108.   <span class="type">const_reference</span> <a href="class.boost.array.html#id2369678-bb">at</a>(size_type) <span class="bold"><b>const</b></span>;
  109.   <span class="type">reference</span> <a href="class.boost.array.html#id2369716-bb">front</a>();
  110.   <span class="type">const_reference</span> <a href="class.boost.array.html#id2369722-bb">front</a>() <span class="bold"><b>const</b></span>;
  111.   <span class="type">reference</span> <a href="class.boost.array.html#id2369750-bb">back</a>();
  112.   <span class="type">const_reference</span> <a href="class.boost.array.html#id2369756-bb">back</a>() <span class="bold"><b>const</b></span>;
  113.   <span class="type"><span class="bold"><b>const</b></span> T*</span> <a href="class.boost.array.html#id2369780-bb">data</a>() <span class="bold"><b>const</b></span>;
  114.   <span class="emphasis"><em>// <a href="class.boost.array.html#id2369801-bb">modifiers</a></em></span>
  115.   <span class="type"><span class="bold"><b>void</b></span></span> <a href="class.boost.array.html#id2369805-bb">swap</a>(<a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  116.   <span class="type"><span class="bold"><b>void</b></span></span> <a href="class.boost.array.html#id2397866-bb">assign</a>(<span class="bold"><b>const</b></span> T&amp;);
  117.   T elems[N];
  118. };
  119. <span class="emphasis"><em>// <a href="class.boost.array.html#id2397903-bb">specialized algorithms</a></em></span>
  120. <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt; <span class="type"><span class="bold"><b>void</b></span></span> <a href="class.boost.array.html#id2397907-bb">swap</a>(<a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  121. <span class="emphasis"><em>// <a href="class.boost.array.html#id2397966-bb">comparisons</a></em></span>
  122. <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  123.   <span class="type"><span class="bold"><b>bool</b></span></span> <a href="class.boost.array.html#id2397970-bb"><span class="bold"><b>operator</b></span>==</a>(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  124. <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  125.   <span class="type"><span class="bold"><b>bool</b></span></span> <a href="class.boost.array.html#id2398034-bb"><span class="bold"><b>operator</b></span>!=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  126. <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  127.   <span class="type"><span class="bold"><b>bool</b></span></span> <a href="class.boost.array.html#id2398087-bb"><span class="bold"><b>operator</b></span>&lt;</a>(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  128. <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  129.   <span class="type"><span class="bold"><b>bool</b></span></span> <a href="class.boost.array.html#id2285456-bb"><span class="bold"><b>operator</b></span>&gt;</a>(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  130. <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  131.   <span class="type"><span class="bold"><b>bool</b></span></span> <a href="class.boost.array.html#id2285509-bb"><span class="bold"><b>operator</b></span>&lt;=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  132. <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  133.   <span class="type"><span class="bold"><b>bool</b></span></span> <a href="class.boost.array.html#id2285561-bb"><span class="bold"><b>operator</b></span>&gt;=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="class.boost.arrayconstruct-copy-destruct"></a><tt class="computeroutput">array</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> U&gt; array&amp; <a name="id2396652-bb"></a><span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;U, N&gt;&amp; other);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Effects</span></b>:
  134. <tt class="computeroutput">std::copy(rhs.<a href="class.boost.array.html#id2396694-bb">begin</a>(),rhs.<a href="class.boost.array.html#id2396722-bb">end</a>(), <a href="class.boost.array.html#id2396694-bb">begin</a>())</tt></p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2396689-bb"></a><tt class="computeroutput">array</tt> iterator support</h3><div class="orderedlist"><ol type="1"><li><p><a name="id2396694-bb"></a></p><pre class="literallayout"><span class="type">iterator</span> <a name="id2396698-bb"></a>begin();
  135. <span class="type">const_iterator</span> <a name="id2396704-bb"></a>begin() <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  136. iterator for the first element<br><b><span class="term">Throws</span></b>:
  137. will not throw</p></li><li><p><a name="id2396722-bb"></a></p><pre class="literallayout"><span class="type">iterator</span> <a name="id2396726-bb"></a>end();
  138. <span class="type">const_iterator</span> <a name="id2396733-bb"></a>end() <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  139. iterator for position after the last element<br><b><span class="term">Throws</span></b>:
  140. will not throw</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2396753-bb"></a><tt class="computeroutput">array</tt> reverse iterator support</h3><div class="orderedlist"><ol type="1"><li><p><a name="id2396757-bb"></a></p><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id2396761-bb"></a>rbegin();
  141. <span class="type">const_reverse_iterator</span> <a name="id2396767-bb"></a>rbegin() <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  142. reverse iterator for the first element of reverse iteration</p></li><li><p><a name="id2396782-bb"></a></p><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id2396786-bb"></a>rend();
  143. <span class="type">const_reverse_iterator</span> <a name="id2396793-bb"></a>rend() <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  144. reverse iterator for position after the last element in reverse iteration</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2396809-bb"></a><tt class="computeroutput">array</tt> capacity</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="type">size_type</span> <a name="id2396813-bb"></a>size();</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  145. <tt class="computeroutput">N</tt></p></li><li><pre class="literallayout"><span class="type"><span class="bold"><b>bool</b></span></span> <a name="id2396827-bb"></a>empty();</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  146. <tt class="computeroutput">N==0</tt><br><b><span class="term">Throws</span></b>:
  147. will not throw</p></li><li><pre class="literallayout"><span class="type">size_type</span> <a name="id2369584-bb"></a>max_size();</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  148. <tt class="computeroutput">N</tt><br><b><span class="term">Throws</span></b>:
  149. will not throw</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2369602-bb"></a><tt class="computeroutput">array</tt> element access</h3><div class="orderedlist"><ol type="1"><li><p><a name="id2369606-bb"></a></p><pre class="literallayout"><span class="type">reference</span> <a name="id2369610-bb"></a><span class="bold"><b>operator</b></span>[](size_type i);
  150. <span class="type">const_reference</span> <a name="id2369625-bb"></a><span class="bold"><b>operator</b></span>[](size_type i) <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Requires</span></b>:
  151. <tt class="computeroutput">i &lt; N</tt><br><b><span class="term">Returns</span></b>:
  152. element with index <tt class="computeroutput">i</tt><br><b><span class="term">Throws</span></b>:
  153. will not throw.</p></li><li><p><a name="id2369659-bb"></a></p><pre class="literallayout"><span class="type">reference</span> <a name="id2369663-bb"></a>at(size_type i);
  154. <span class="type">const_reference</span> <a name="id2369678-bb"></a>at(size_type i) <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  155. element with index <tt class="computeroutput">i</tt><br><b><span class="term">Throws</span></b>:
  156. <tt class="computeroutput">std::range_error</tt> if <tt class="computeroutput">i &gt;= N</tt></p></li><li><p><a name="id2369712-bb"></a></p><pre class="literallayout"><span class="type">reference</span> <a name="id2369716-bb"></a>front();
  157. <span class="type">const_reference</span> <a name="id2369722-bb"></a>front() <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Requires</span></b>:
  158. <tt class="computeroutput">N &gt; 0</tt><br><b><span class="term">Returns</span></b>:
  159. the first element<br><b><span class="term">Throws</span></b>:
  160. will not throw</p></li><li><p><a name="id2369746-bb"></a></p><pre class="literallayout"><span class="type">reference</span> <a name="id2369750-bb"></a>back();
  161. <span class="type">const_reference</span> <a name="id2369756-bb"></a>back() <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Requires</span></b>:
  162. <tt class="computeroutput">N &gt; 0</tt><br><b><span class="term">Returns</span></b>:
  163. the last element<br><b><span class="term">Throws</span></b>:
  164. will not throw</p></li><li><pre class="literallayout"><span class="type"><span class="bold"><b>const</b></span> T*</span> <a name="id2369780-bb"></a>data() <span class="bold"><b>const</b></span>;</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  165. <tt class="computeroutput">elems</tt><br><b><span class="term">Throws</span></b>:
  166. will not throw</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2369801-bb"></a><tt class="computeroutput">array</tt> modifiers</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="type"><span class="bold"><b>void</b></span></span> <a name="id2369805-bb"></a>swap(<a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; other);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Effects</span></b>:
  167. <tt class="computeroutput">std::swap_ranges(<a href="class.boost.array.html#id2396694-bb">begin</a>(), <a href="class.boost.array.html#id2396722-bb">end</a>(), other.<a href="class.boost.array.html#id2396694-bb">begin</a>())</tt><br><b><span class="term">Complexity</span></b>:
  168. linear in <tt class="computeroutput">N</tt></p></li><li><pre class="literallayout"><span class="type"><span class="bold"><b>void</b></span></span> <a name="id2397866-bb"></a>assign(<span class="bold"><b>const</b></span> T&amp; value);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Effects</span></b>:
  169. <tt class="computeroutput">std::fill_n(<a href="class.boost.array.html#id2396694-bb">begin</a>(), N, value)</tt></p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2397903-bb"></a><tt class="computeroutput">array</tt> specialized algorithms</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt; <span class="type"><span class="bold"><b>void</b></span></span> <a name="id2397907-bb"></a>swap(<a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Effects</span></b>:
  170. <tt class="computeroutput">x.<a href="class.boost.array.html#id2369805-bb">swap</a>(y)</tt><br><b><span class="term">Throws</span></b>:
  171. will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2397966-bb"></a><tt class="computeroutput">array</tt> comparisons</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  172.   <span class="type"><span class="bold"><b>bool</b></span></span> <a name="id2397970-bb"></a><span class="bold"><b>operator</b></span>==(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  173. <tt class="computeroutput">std::equal(x.<a href="class.boost.array.html#id2396694-bb">begin</a>(), x.<a href="class.boost.array.html#id2396722-bb">end</a>(), y.<a href="class.boost.array.html#id2396694-bb">begin</a>())</tt></p></li><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  174.   <span class="type"><span class="bold"><b>bool</b></span></span> <a name="id2398034-bb"></a><span class="bold"><b>operator</b></span>!=(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  175. <tt class="computeroutput">!(x == y)</tt></p></li><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  176.   <span class="type"><span class="bold"><b>bool</b></span></span> <a name="id2398087-bb"></a><span class="bold"><b>operator</b></span>&lt;(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  177. <tt class="computeroutput">std::lexicographical_compare(x.<a href="class.boost.array.html#id2396694-bb">begin</a>(), x.<a href="class.boost.array.html#id2396722-bb">end</a>(), y.<a href="class.boost.array.html#id2396694-bb">begin</a>(), y.<a href="class.boost.array.html#id2396722-bb">end</a>())</tt></p></li><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  178.   <span class="type"><span class="bold"><b>bool</b></span></span> <a name="id2285456-bb"></a><span class="bold"><b>operator</b></span>&gt;(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  179. <tt class="computeroutput">y &lt; x</tt></p></li><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  180.   <span class="type"><span class="bold"><b>bool</b></span></span> <a name="id2285509-bb"></a><span class="bold"><b>operator</b></span>&lt;=(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  181. <tt class="computeroutput">!(y &lt; x)</tt></p></li><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T, std::size_t N&gt;
  182.   <span class="type"><span class="bold"><b>bool</b></span></span> <a name="id2285561-bb"></a><span class="bold"><b>operator</b></span>&gt;=(<span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><b>const</b></span> <a href="class.boost.array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre><p xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><b><span class="term">Returns</span></b>:
  183. <tt class="computeroutput">!(x &lt; y)</tt></p></li></ol></div></div></div></div><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr><td align="left"><small>Last revised: , at GMT</small></td><td align="right"><small>Copyright © 2001 Nicolai M. Josuttis</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="array.reference.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="array.reference.html#header.boost.array.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="array.rationale.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Design Rationale</td></tr></table></div></body></html>
粤ICP备19079148号