Compare commits

..

4 Commits

Author SHA1 Message Date
54b65a0d7c This commit was manufactured by cvs2svn to create tag
'Version_1_18_0'.

[SVN r7873]
2000-09-29 11:39:43 +00:00
8c5daba6b3 I have no idea why CVS wants this file re-committed
[SVN r7867]
2000-09-28 12:41:28 +00:00
6533fa4606 Initial Graph and Regex HTML integration
[SVN r7849]
2000-09-26 19:02:50 +00:00
e3d87e942c Minor html fixes
[SVN r7771]
2000-09-22 18:10:39 +00:00
3 changed files with 212 additions and 217 deletions

View File

@ -41,7 +41,7 @@
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//&nbsp;BUG-FIX&nbsp;for&nbsp;compilers&nbsp;that&nbsp;don't&nbsp;support</FONT></I><BR> <I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//&nbsp;BUG-FIX&nbsp;for&nbsp;compilers&nbsp;that&nbsp;don't&nbsp;support</FONT></I><BR>
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//&nbsp;std::size_t&nbsp;and&nbsp;std::ptrdiff_t&nbsp;yet</FONT></I><BR> <I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//&nbsp;std::size_t&nbsp;and&nbsp;std::ptrdiff_t&nbsp;yet</FONT></I><BR>
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//&nbsp;(such&nbsp;as&nbsp;gcc)</FONT></I><BR> <I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//&nbsp;(such&nbsp;as&nbsp;gcc)</FONT></I><BR>
#include&nbsp;&lt;<A href="./config.hpp.html">boost/config.hpp</A>&gt;<BR> #include&nbsp;&lt;<A href="../../boost/config.hpp">boost/config.hpp</A>&gt;<BR>
<BR> <BR>
namespace&nbsp;boost&nbsp;{<BR> namespace&nbsp;boost&nbsp;{<BR>
<BR> <BR>

View File

@ -1,320 +1,315 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Keywords" content="array, block, carray, c_array, array wrapper, adapter, adaptor, STL, C++ Standard Library, array.hpp"> <meta name="Keywords" content="array, block, carray, c_array, array wrapper, adapter, adaptor, STL, C++ Standard Library, array.hpp">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>array.hpp, an STL Array Wrapper</title> <title>array.hpp, an STL Array Wrapper</title>
</head> </head>
<body text="#000000" bgcolor="#FFFFFF" link="#186ABF"> <body text="#000000" bgcolor="#FFFFFF" link="#186ABF">
<font face="Arial, Helvetica, sans-serif">&nbsp; </font>
<font face="Arial, Helvetica, sans-serif">&nbsp;</font>
<table width="100%" height="40"> <table width="100%" height="40">
<tr> <tr>
<td BGCOLOR="#DDDDDD"><b><font face="Arial,helvetica" color="#000000" size="+1">Class <td bgcolor="#DDDDDD"><b><font face="Arial,helvetica" color="#000000" size="+1">Class
<font face="Courier New, Courier, mono">array</font>, an STL Container (as <font face="Courier New, Courier, mono">array</font>, an STL Container (as
Wrapper) for Arrays of Constant Size</font></b></td> Wrapper) for Arrays of Constant Size</font></b></td>
</tr> </tr>
</table> </table>
<p><font face="Arial, Helvetica, sans-serif" size="-1">The C++ Standard Template <p><font face="Arial, Helvetica, sans-serif" size="-1">The C++ Standard Template
Library STL as part of the C++ Standard Library provides a framework for processing Library STL as part of the C++ Standard Library provides a framework for
algorithms on different kind of containers. However, ordinary arrays don't provide processing algorithms on different kind of containers. However, ordinary arrays
the interface of STL containers (although, they provide the iterator interface don't provide the interface of STL containers (although, they provide the
of STL containers).</font> iterator interface of STL containers).</font>
<p><font face="Arial, Helvetica, sans-serif" size="-1">As replacement for ordinary <p><font face="Arial, Helvetica, sans-serif" size="-1">As replacement for
arrays, the STL provides class <font face="Courier New, Courier, mono">vector&lt;&gt;</font>. ordinary arrays, the STL provides class <font face="Courier New, Courier, mono">vector&lt;&gt;</font>.
However, <font face="Courier New, Courier, mono">vector&lt;&gt;</font> provides However, <font face="Courier New, Courier, mono">vector&lt;&gt;</font> provides
the semantics of dynamic arrays. Thus, it manages data to be able to change the semantics of dynamic arrays. Thus, it manages data to be able to change the
the number of elements. This results in some overhead in case only arrays with number of elements. This results in some overhead in case only arrays with
static size are needed.</font> static size are needed.</font>
<p><font face="Arial, Helvetica, sans-serif" size="-1">In his book, <i>Generic <p><font face="Arial, Helvetica, sans-serif" size="-1">In his book, <i>Generic
Programming and the STL</i>, Matthew H. Austern introduces a useful wrapper Programming and the STL</i>, Matthew H. Austern introduces a useful wrapper
class for ordinary arrays with static size, called <font face="Courier New, Courier, mono"><b>block</b></font>. class for ordinary arrays with static size, called <font face="Courier New, Courier, mono"><b>block</b></font>.
It is safer and has no worse performance than ordinary arrays. In <i>The C++ It is safer and has no worse performance than ordinary arrays. In <i>The C++
Programming Language</i>, 3rd edition, Bjarne Stroustrup introduces a similar Programming Language</i>, 3rd edition, Bjarne Stroustrup introduces a similar
class, called <font face="Courier New, Courier, mono"><b>c_array</b></font>, class, called <font face="Courier New, Courier, mono"><b>c_array</b></font>,
which I (<a href="http://www.josuttis.com">Nicolai Josuttis</a>) present slightly which I (<a href="http://www.josuttis.com">Nicolai Josuttis</a>) present
modified in my book <i>The C++ Standard Library - A Tutorial and Reference</i>, slightly modified in my book <i>The C++ Standard Library - A Tutorial and
called <font face="Courier New, Courier, mono"><b>carray</b></font>. This is Reference</i>, called <font face="Courier New, Courier, mono"><b>carray</b></font>.
the essence of these approaches spiced with many feedback from <a href="http://www.boost.org">boost</a>.</font> This is the essence of these approaches spiced with many feedback from <a href="http://www.boost.org">boost</a>.</font>
<p><font face="Arial, Helvetica, sans-serif" size="-1">After considering different <p><font face="Arial, Helvetica, sans-serif" size="-1">After considering
names, we decided to name this class simply <font face="Courier New, Courier, mono"><b>array</b></font>.</font> different names, we decided to name this class simply <font face="Courier New, Courier, mono"><b>array</b></font>.</font>
<p><font face="Arial, Helvetica, sans-serif" size="-1">The class provides the <p><font face="Arial, Helvetica, sans-serif" size="-1">The class provides the
following interface:</font> following interface:</font>
<table border="0"> <table border="0">
<tr> <tr>
<td><font face="Arial, Helvetica, sans-serif" size="-1"><b>Types:</b></font></td> <td><font face="Arial, Helvetica, sans-serif" size="-1"><b>Types:</b></font></td>
<td><font size="-1"></font></td> <td><font size="-1"></font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">value_type</font></td> <td><font face="Courier New, Courier, mono" size="-1">value_type</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of the elements</font></td> <td><font face="Arial, Helvetica, sans-serif" size="-1">type of the elements</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">iterator</font></td> <td><font face="Courier New, Courier, mono" size="-1">iterator</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of the iterator <td><font face="Arial, Helvetica, sans-serif" size="-1">type of the iterator
(random-access iterator)</font></td> (random-access iterator)</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">const_iterator</font></td> <td><font face="Courier New, Courier, mono" size="-1">const_iterator</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of iterator that <td><font face="Arial, Helvetica, sans-serif" size="-1">type of iterator
considers elements as being constant</font></td>
</tr>
<tr>
<td><font face="Courier New, Courier, mono" size="-1">reference</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of element reference</font></td>
</tr>
<tr>
<td><font face="Courier New, Courier, mono" size="-1">const_reference</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of element reference
that considers elements as being constant</font></td> that considers elements as being constant</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">reference</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of element
reference</font></td>
</tr>
<tr>
<td><font face="Courier New, Courier, mono" size="-1">const_reference</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of element
reference that considers elements as being constant</font></td>
</tr>
<tr>
<td><font face="Courier New, Courier, mono" size="-1">size_type</font></td> <td><font face="Courier New, Courier, mono" size="-1">size_type</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type for signed size <td><font face="Arial, Helvetica, sans-serif" size="-1">type for signed size
values</font></td> values</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">difference_type</font></td> <td><font face="Courier New, Courier, mono" size="-1">difference_type</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">type for unsigned <td><font face="Arial, Helvetica, sans-serif" size="-1">type for unsigned
difference values</font></td> difference values</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Arial, Helvetica, sans-serif" size="-1"><b>Operations:</b></font></td> <td><font face="Arial, Helvetica, sans-serif" size="-1"><b>Operations:</b></font></td>
<td><font size="-1"></font></td> <td><font size="-1"></font></td>
</tr> </tr>
<tr> <tr>
<td> <td>
<p><font face="Courier New, Courier, mono" size="-1">array&lt;<i>type</i>,<i>num</i>&gt;</font></p> <p><font face="Courier New, Courier, mono" size="-1">array&lt;<i>type</i>,<i>num</i>&gt;</font></p>
</td> </td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">default constructor, <td><font face="Arial, Helvetica, sans-serif" size="-1">default constructor,
creates array of <i><font face="Courier New, Courier, mono">num</font></i> creates array of <i><font face="Courier New, Courier, mono">num</font></i>
element of <i><font face="Courier New, Courier, mono">type</font></i>, see element of <i><font face="Courier New, Courier, mono">type</font></i>, see
comment below</font></td> comment below</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">array&lt;<i>type</i>,<i>num</i>&gt;(<i>a</i>)</font></td> <td><font face="Courier New, Courier, mono" size="-1">array&lt;<i>type</i>,<i>num</i>&gt;(<i>a</i>)</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">copy constructor, <td><font face="Arial, Helvetica, sans-serif" size="-1">copy constructor,
copies all elements of <i><font face="Courier New, Courier, mono">a</font></i> copies all elements of <i><font face="Courier New, Courier, mono">a</font></i>
(<i><font face="Courier New, Courier, mono">a</font></i> must have same (<i><font face="Courier New, Courier, mono">a</font></i> must have same <i><font face="Courier New, Courier, mono">type</font></i><font face="Courier New, Courier, mono"><font face="Arial, Helvetica, sans-serif">
<i> <font face="Courier New, Courier, mono">type</font></i><font face="Courier New, Courier, mono"><font face="Arial, Helvetica, sans-serif">
and </font></font><i><font face="Courier New, Courier, mono">num</font></i>)</font></td> and </font></font><i><font face="Courier New, Courier, mono">num</font></i>)</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">operator=</font></td> <td><font face="Courier New, Courier, mono" size="-1">operator=</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">assignment, assigns <td><font face="Arial, Helvetica, sans-serif" size="-1">assignment, assigns
all elements</font></td> all elements</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">assign(<i>val</i>)</font></td> <td><font face="Courier New, Courier, mono" size="-1">assign(<i>val</i>)</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">assigns <i>val</i> <td><font face="Arial, Helvetica, sans-serif" size="-1">assigns <i>val</i>
to all elements</font></td> to all elements</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">begin()</font></td> <td><font face="Courier New, Courier, mono" size="-1">begin()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns iterator for <td><font face="Arial, Helvetica, sans-serif" size="-1">returns iterator for
the first element</font></td> the first element</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">end()</font></td> <td><font face="Courier New, Courier, mono" size="-1">end()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns iterator for <td><font face="Arial, Helvetica, sans-serif" size="-1">returns iterator for
position after the last element</font></td> position after the last element</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">rbegin()</font></td> <td><font face="Courier New, Courier, mono" size="-1">rbegin()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns reverse iterator <td><font face="Arial, Helvetica, sans-serif" size="-1">returns reverse
for position of first element of reverse iteration</font></td> iterator for position of first element of reverse iteration</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">rend()</font></td> <td><font face="Courier New, Courier, mono" size="-1">rend()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns reverse iterator <td><font face="Arial, Helvetica, sans-serif" size="-1">returns reverse
for posistion behind last element of reverese iteration </font></td> iterator for posistion behind last element of reverese iteration</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">operator[<i>i</i>]</font></td> <td><font face="Courier New, Courier, mono" size="-1">operator[<i>i</i>]</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns element with <td><font face="Arial, Helvetica, sans-serif" size="-1">returns element with
index <i><font face="Courier New, Courier, mono">i</font></i> (no range index <i><font face="Courier New, Courier, mono">i</font></i> (no range
checking)</font></td> checking)</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">at(<i>i</i>)</font></td> <td><font face="Courier New, Courier, mono" size="-1">at(<i>i</i>)</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns element with <td><font face="Arial, Helvetica, sans-serif" size="-1">returns element with
index <font face="Courier New, Courier, mono"><i>i</i></font> (throw std::range_error index <font face="Courier New, Courier, mono"><i>i</i></font> (throw
if <i><font face="Courier New, Courier, mono">i</font></i> is not valid)</font></td> std::range_error if <i><font face="Courier New, Courier, mono">i</font></i>
is not valid)</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">front()</font></td> <td><font face="Courier New, Courier, mono" size="-1">front()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns first element <td><font face="Arial, Helvetica, sans-serif" size="-1">returns first
(caller has to ensure that it exists)</font></td> element (caller has to ensure that it exists)</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">back()</font></td> <td><font face="Courier New, Courier, mono" size="-1">back()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns last element <td><font face="Arial, Helvetica, sans-serif" size="-1">returns last element
(caller has to ensure that it exists)</font></td> (caller has to ensure that it exists)</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">data()</font></td> <td><font face="Courier New, Courier, mono" size="-1">data()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns raw element <td><font face="Arial, Helvetica, sans-serif" size="-1">returns raw element
array for read-only element access</font></td> array for read-only element access</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">size()</font></td> <td><font face="Courier New, Courier, mono" size="-1">size()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns number of <td><font face="Arial, Helvetica, sans-serif" size="-1">returns number of
elements</font></td> elements</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">empty()</font></td> <td><font face="Courier New, Courier, mono" size="-1">empty()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns whether array <td><font face="Arial, Helvetica, sans-serif" size="-1">returns whether
is empty</font></td> array is empty</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">max_size()</font></td> <td><font face="Courier New, Courier, mono" size="-1">max_size()</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">returns maximum possible <td><font face="Arial, Helvetica, sans-serif" size="-1">returns maximum
number of elements (same as size())</font></td> possible number of elements (same as size())</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">swap(a)</font></td> <td><font face="Courier New, Courier, mono" size="-1">swap(a)</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">swap elements with <td><font face="Arial, Helvetica, sans-serif" size="-1">swap elements with
array a</font></td> array a</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">==<font face="Arial, Helvetica, sans-serif">, <td><font face="Courier New, Courier, mono" size="-1">==<font face="Arial, Helvetica, sans-serif">,
</font>!=</font></td> </font>!=</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">checks for equality</font></td> <td><font face="Arial, Helvetica, sans-serif" size="-1">checks for equality</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">&lt;<font face="Arial, Helvetica, sans-serif">, <td><font face="Courier New, Courier, mono" size="-1">&lt;<font face="Arial, Helvetica, sans-serif">,
</font>&lt;=<font face="Arial, Helvetica, sans-serif">, </font>&gt;<font face="Arial, Helvetica, sans-serif">, </font>&lt;=<font face="Arial, Helvetica, sans-serif">, </font>&gt;<font face="Arial, Helvetica, sans-serif">,
</font>&gt;=</font></td> </font>&gt;=</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="-1">compares array</font></td> <td><font face="Arial, Helvetica, sans-serif" size="-1">compares array</font></td>
</tr> </tr>
<tr> <tr>
<td><font face="Arial, Helvetica, sans-serif" size="-1"><b>Values:</b></font></td> <td><font face="Arial, Helvetica, sans-serif" size="-1"><b>Values:</b></font></td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td><font face="Courier New, Courier, mono" size="-1">static_size</font></td> <td><font face="Courier New, Courier, mono" size="-1">static_size</font></td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">yields size at compile <td><font size="-1" face="Arial, Helvetica, sans-serif">yields size at
time</font></td> compile time</font></td>
</tr> </tr>
</table> </table>
<p><font face="Arial, Helvetica, sans-serif" size="-1">Class array fulfills most <p><font face="Arial, Helvetica, sans-serif" size="-1">Class array fulfills most
but not all of the requirements of &quot;reversible containers&quot; (see Section but not all of the requirements of &quot;reversible containers&quot; (see
23.1, [lib.container.requirements] of the C++ Standard). The reasons array is Section 23.1, [lib.container.requirements] of the C++ Standard). The reasons
not an reversible STL container is because: </font> <font face="Arial, Helvetica, sans-serif" size="-1"><br> array is not an reversible STL container is because:</font><font face="Arial, Helvetica, sans-serif" size="-1"><br>
- No constructors are provided<br> - No constructors are provided<br>
- Elements may have an indetermined initial value (see below)<br> - Elements may have an indetermined initial value (see below)<br>
- swap() has no constant complexity<br> - swap() has no constant complexity<br>
- size() is always constant, based on the second template argument of the type<br> - size() is always constant, based on the second template argument of the type<br>
- The container provides no allocator support</font> - The container provides no allocator support</font>
<p><font face="Arial, Helvetica, sans-serif" size="-1">It doesn't fulfill the <p><font face="Arial, Helvetica, sans-serif" size="-1">It doesn't fulfill the
requirements of a &quot;sequence&quot; (see Section 23.1.1, [lib.sequence.reqmts] requirements of a &quot;sequence&quot; (see Section 23.1.1, [lib.sequence.reqmts]
of the C++ Standard), except that</font> <font face="Arial, Helvetica, sans-serif" size="-1"><br> of the C++ Standard), except that</font><font face="Arial, Helvetica, sans-serif" size="-1"><br>
- front() and back() are provided<br> - front() and back() are provided<br>
- operator[] and at() are provided</font> - operator[] and at() are provided</font>
<p><font face="Arial, Helvetica, sans-serif" size="-1">Regarding the constructors <p><font face="Arial, Helvetica, sans-serif" size="-1">Regarding the
there was an important design tradeoff: We could implement array as an &quot;<b>aggregate</b>&quot; constructors there was an important design tradeoff: We could implement array as
(see Section 8.5.1, [dcl.init.aggr], of the C++ Standard). This would mean:</font></p> an &quot;<b>aggregate</b>&quot; (see Section 8.5.1, [dcl.init.aggr], of the C++
Standard). This would mean:</font></p>
<ul> <ul>
<li><font face="Arial, Helvetica, sans-serif" size="-1">An array can be initialized <li><font face="Arial, Helvetica, sans-serif" size="-1">An array can be
with a brace-enclosing, comma-separated list of initializers for the elements initialized with a brace-enclosing, comma-separated list of initializers for
of the container, written in increasing subscript order:</font> the elements of the container, written in increasing subscript order:</font>
<blockquote> <blockquote>
<p><font face="Arial, Helvetica, sans-serif" size="-1">boost::array&lt;int,4&gt; <p><font face="Arial, Helvetica, sans-serif" size="-1">boost::array&lt;int,4&gt;
a = { { 1, 2, 3 } };</font></p> a = { { 1, 2, 3 } };</font></p>
</blockquote> </blockquote>
<p><font face="Arial, Helvetica, sans-serif" size="-1">Note that if there <p><font face="Arial, Helvetica, sans-serif" size="-1">Note that if there
are fewer elements in the initializer list, then each remaining element are fewer elements in the initializer list, then each remaining element gets
gets default-initialized (thus, it has a defined value).</font></p> default-initialized (thus, it has a defined value).</font></p>
</li> </li>
<li><font face="Arial, Helvetica, sans-serif" size="-1">However, <b>passing <li><font face="Arial, Helvetica, sans-serif" size="-1">However, <b>passing no
no initializer list means that the elements have an indetermined initial value</b>.</font></li> initializer list means that the elements have an indetermined initial value</b>.</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="-1">It has no user-declared <li><font face="Arial, Helvetica, sans-serif" size="-1">It has no
constructors.</font></li> user-declared constructors.</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="-1">It has no private or <li><font face="Arial, Helvetica, sans-serif" size="-1">It has no private or
protected non-static data members.</font></li> protected non-static data members.</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="-1">It has no base classes.</font></li> <li><font face="Arial, Helvetica, sans-serif" size="-1">It has no base
<li><font face="Arial, Helvetica, sans-serif" size="-1">It has no virtual functions.</font></li> classes.</font></li>
<li><font face="Arial, Helvetica, sans-serif" size="-1">It has no virtual
functions.</font></li>
</ul> </ul>
<p><font face="Arial, Helvetica, sans-serif" size="-1">The current implementation <p><font face="Arial, Helvetica, sans-serif" size="-1">The current
useus this approach. However, being able to have indetermined initial values implementation useus this approach. However, being able to have indetermined
is a big drawback. So, please give me some feedback, how useful you consider initial values is a big drawback. So, please give me some feedback, how useful
this feature to be. This leads to the list of <b>Open issues:</b></font> you consider this feature to be. This leads to the list of <b>Open issues:</b></font>
<ul> <ul>
<li><font face="Arial, Helvetica, sans-serif">Do we want initializer list support <li><font face="Arial, Helvetica, sans-serif">Do we want initializer list
or would the following be OK?:</font> support or would the following be OK?:</font>
<blockquote> <blockquote>
<p><font face="Courier New, Courier, mono">int data[] = { 1, 2, 3, 4 }</font></p> <p><font face="Courier New, Courier, mono">int data[] = { 1, 2, 3, 4 }</font></p>
<p><font face="Courier New, Courier, mono">array&lt;int,5&gt; x(data); <font face="Arial, Helvetica, sans-serif">or <p><font face="Courier New, Courier, mono">array&lt;int,5&gt; x(data); <font face="Arial, Helvetica, sans-serif">or
</font>&nbsp;&nbsp;array&lt;int,data&gt; x;</font></p> </font>&nbsp;&nbsp;array&lt;int,data&gt; x;</font></p>
</blockquote> </blockquote>
</li> </li>
<li><font face="Arial, Helvetica, sans-serif">Could &quot;<font face="Courier New, Courier, mono">{ <li><font face="Arial, Helvetica, sans-serif">Could &quot;<font face="Courier New, Courier, mono">{
</font>...<font face="Courier New, Courier, mono"> }</font>&quot; be used </font>...<font face="Courier New, Courier, mono"> }</font>&quot; be used
portably instead of &quot;<font face="Courier New, Courier, mono">{ { </font>...<font face="Courier New, Courier, mono"> portably instead of &quot;<font face="Courier New, Courier, mono">{ { </font>...<font face="Courier New, Courier, mono">
} }</font>&quot; to initialize values?</font> </li> } }</font>&quot; to initialize values?</font></li>
<blockquote> <blockquote>
<p><font face="Arial, Helvetica, sans-serif">8.5.1 (11) of the Standard seem <p><font face="Arial, Helvetica, sans-serif">8.5.1 (11) of the Standard seem
to allow it; however, gcc 2.95.2 printa warning message.</font></p> to allow it; however, gcc 2.95.2 printa warning message.</font></p>
</blockquote> </blockquote>
<li><font face="Arial, Helvetica, sans-serif">Any way to have determined initial <li><font face="Arial, Helvetica, sans-serif">Any way to have determined
values and initializer list support?</font></li> initial values and initializer list support?</font></li>
<li><font face="Arial, Helvetica, sans-serif">Static_casts for reverse iterator <li><font face="Arial, Helvetica, sans-serif">Static_casts for reverse
stuff</font><font face="Arial, Helvetica, sans-serif">?</font></li> iterator stuff</font><font face="Arial, Helvetica, sans-serif">?</font></li>
</ul> </ul>
<p><font face="Arial, Helvetica, sans-serif">I'd appreciate any constructive <a href="mailto:solutions@josuttis.com">feedback</a>. <p><font face="Arial, Helvetica, sans-serif">I'd appreciate any constructive <a href="mailto:solutions@josuttis.com">feedback</a>.
<b>Please note: I don't have time to read all boost mails. Thus, to make sure <b>Please note: I don't have time to read all boost mails. Thus, to make sure
that feedback arrives me, please send me a copy of each mail regarding this that feedback arrives me, please send me a copy of each mail regarding this
class.</b></font> class.</b></font>
<p><font face="Arial, Helvetica, sans-serif">The code is provided "as is" without <p><font face="Arial, Helvetica, sans-serif">The code is provided &quot;as
expressed or implied warranty.</font> is&quot; without expressed or implied warranty.</font>
<p><font face="Arial, Helvetica, sans-serif"><b>array.hpp</b>, the implementation <p><font face="Arial, Helvetica, sans-serif"><b>array.hpp</b>, the
of <font face="Courier New, Courier, mono">array&lt;&gt;</font><b>:</b> </font> implementation of <font face="Courier New, Courier, mono">array&lt;&gt;</font><b>:</b>
<li><font face="Arial, Helvetica, sans-serif"> </font><font face="Arial, Helvetica, sans-serif"><a href="array.hpp.html">as
<a href="array.hpp.html">as HTML file</a></font></li> HTML file</a></font> <font face="Arial, Helvetica, sans-serif"><a href="../../boost/array.hpp">as
<li><font face="Arial, Helvetica, sans-serif"> plain file</a></font>
<a href="array.hpp">as plain file</a></font></li> <p><font face="Arial, Helvetica, sans-serif">Simple Example for using <font face="Courier New, Courier, mono">array&lt;&gt;<font face="Arial, Helvetica, sans-serif">:</font></font></font>
<p> <font face="Arial, Helvetica, sans-serif">Simple Example for using <font face="Courier New, Courier, mono">array&lt;&gt;<font face="Arial, Helvetica, sans-serif">:</font></font></font> <font face="Arial, Helvetica, sans-serif"><a href="array1.cpp.html">as HTML file</a></font>
<li><font face="Arial, Helvetica, sans-serif"> <font face="Arial, Helvetica, sans-serif"><a href="array1.cpp">as plain file</a></font>
<a href="array1.cpp.html">as HTML file</a></font> </li> <p><font face="Arial, Helvetica, sans-serif">Another Example for using <font face="Courier New, Courier, mono">array&lt;&gt;<font face="Arial, Helvetica, sans-serif">:</font></font></font>
<li><font face="Arial, Helvetica, sans-serif"> <font face="Arial, Helvetica, sans-serif"><a href="array2.cpp.html">as HTML file</a></font>
<a href="array1.cpp">as plain file</a></font></li> <font face="Arial, Helvetica, sans-serif"><a href="array2.cpp">as plain file</a></font>
<p> <font face="Arial, Helvetica, sans-serif">Another Example for using <font face="Courier New, Courier, mono">array&lt;&gt;<font face="Arial, Helvetica, sans-serif">:</font></font></font> <p><font face="Arial, Helvetica, sans-serif">A third Example for using <font face="Courier New, Courier, mono">array&lt;&gt;<font face="Arial, Helvetica, sans-serif">:</font></font></font>
<li><font face="Arial, Helvetica, sans-serif"> <font face="Arial, Helvetica, sans-serif"><a href="array3.cpp.html">as HTML file</a></font>
<a href="array2.cpp.html">as HTML file</a></font></li> <font face="Arial, Helvetica, sans-serif"><a href="array3.cpp">as plain file</a></font>
<li><font face="Arial, Helvetica, sans-serif"> <p><font face="Arial, Helvetica, sans-serif">An Example for using <font face="Courier New, Courier, mono">array</font>s
<a href="array2.cpp">as plain file</a></font></li> of <font face="Courier New, Courier, mono">array</font>s<font face="Courier New, Courier, mono"><font face="Arial, Helvetica, sans-serif">:</font></font></font>
<p> <font face="Arial, Helvetica, sans-serif">A third Example for using <font face="Courier New, Courier, mono">array&lt;&gt;<font face="Arial, Helvetica, sans-serif">:</font></font></font> <font face="Arial, Helvetica, sans-serif"><a href="array4.cpp.html">as HTML file</a></font>
<li><font face="Arial, Helvetica, sans-serif"> <font face="Arial, Helvetica, sans-serif"><a href="array4.cpp">as plain file</a></font>
<a href="array3.cpp.html">as HTML file</a></font></li> <p><font face="Arial, Helvetica, sans-serif">An Example for testing other
<li><font face="Arial, Helvetica, sans-serif"> operations of <font face="Courier New, Courier, mono">array&lt;&gt;</font><font face="Courier New, Courier, mono"><font face="Arial, Helvetica, sans-serif">:</font></font></font>
<a href="array3.cpp">as plain file</a></font></li> <font face="Arial, Helvetica, sans-serif"><a href="array5.cpp.html">as HTML file</a></font>
<p> <font face="Arial, Helvetica, sans-serif">An Example for using <font face="Courier New, Courier, mono">array</font>s <font face="Arial, Helvetica, sans-serif"><a href="array5.cpp">as plain file</a></font>
of <font face="Courier New, Courier, mono">array</font>s<font face="Courier New, Courier, mono"><font face="Arial, Helvetica, sans-serif">:</font></font></font> <p><font face="Arial, Helvetica, sans-serif">To find more details about using
<li><font face="Arial, Helvetica, sans-serif"> <a href="array4.cpp.html">as HTML ordinary arrays in C++ and the framework of the STL, see e.g.</font><font face="Arial, Helvetica, sans-serif"><br>
file</a></font></li> <i>&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.josuttis.com/libbook/">The C++
<li><font face="Arial, Helvetica, sans-serif"> <a href="array4.cpp">as plain file</a></font></li> Standard Library - A Tutorial and Reference</a></i><br>
<p><font face="Arial, Helvetica, sans-serif">An Example for testing other operations &nbsp;&nbsp;&nbsp;&nbsp; by <a href="http://www.josuttis.com" target="_top">Nicolai
of <font face="Courier New, Courier, mono">array&lt;&gt;</font><font face="Courier New, Courier, mono"><font face="Arial, Helvetica, sans-serif">:</font></font></font> M. Josuttis</a></font><font face="Arial, Helvetica, sans-serif"><br>
<li><font face="Arial, Helvetica, sans-serif"> <a href="array5.cpp.html">as HTML &nbsp;&nbsp;&nbsp;&nbsp; Addison Wesley Longman, 1999</font><font face="Arial, Helvetica, sans-serif"><br>
file</a></font></li> &nbsp;&nbsp;&nbsp;&nbsp; ISBN 0-201-37926-0</font><font face="Arial, Helvetica, sans-serif"><br>
<li><font face="Arial, Helvetica, sans-serif"> <a href="array5.cpp">as plain file</a></font></li> </font>
<p><b><font face="Arial, Helvetica, sans-serif">All files</font></b> <p><font face="Arial, Helvetica, sans-serif"><a href="http://www.josuttis.com/" target="_top">Home
<li><font face="Arial, Helvetica, sans-serif"> <a href="array.zip">as ZIP file Page of Nicolai Josuttis</a></font><font face="Arial, Helvetica, sans-serif"><br>
(24KB)</a></font></li> &nbsp;</font>
<li><font face="Arial, Helvetica, sans-serif"> <a href="array.tgz">as TGZ file
(13KB)</a><br>
<br>
To find more details about using ordinary arrays in C++ and the framework of
the STL, see e.g.</font> <font face="Arial, Helvetica, sans-serif"><br>
<i>&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.josuttis.com/libbook/">The C++
Standard Library - A Tutorial and Reference</a></i> <br>
&nbsp;&nbsp;&nbsp;&nbsp; by <a href="http://www.josuttis.com" target="_top">Nicolai
M. Josuttis</a></font> <font face="Arial, Helvetica, sans-serif"><br>
&nbsp;&nbsp;&nbsp;&nbsp; Addison Wesley Longman, 1999</font> <font face="Arial, Helvetica, sans-serif"><br>
&nbsp;&nbsp;&nbsp;&nbsp; ISBN 0-201-37926-0</font> <font face="Arial, Helvetica, sans-serif"><br>
</font></li>
<p><font face="Arial, Helvetica, sans-serif"><a href="http://www.josuttis.com/" TARGET="_top">Home
Page of Nicolai Josuttis</a></font> <font face="Arial, Helvetica, sans-serif"><br>
&nbsp; </font>
</body> </body>
</html> </html>

View File

@ -23,13 +23,13 @@
<p>The header array.hpp provides an STL compliant container wrapper for arrays <p>The header array.hpp provides an STL compliant container wrapper for arrays
of constant size. of constant size.
<ul> <ul>
<li><a href="array.htm">Documentation</a> (HTML).</li> <li><a href="array.html">Documentation</a> (HTML).</li>
<li>Header <a href="../../boost/array.hpp">array.hpp</a></li> <li>Header <a href="../../boost/array.hpp">array.hpp</a></li>
<li>See docs for links to example programs.</li> <li>See docs for links to example programs.</li>
<li>Download <a href="../../boost_all.zip">all of Boost</a> (ZIP format).</li> <li>Download <a href="../../boost_all.zip">all of Boost</a> (ZIP format).</li>
<li>Submitted by <a href="http://www.josuttis.com">Nicolai M. Josuttis</a>.</li> <li>Submitted by <a href="http://www.josuttis.com">Nicolai M. Josuttis</a>.</li>
</ul> </ul>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->02 Aug 2000<!--webbot bot="Timestamp" endspan i-checksum="14748" --></p> <p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->27 Sep 2000<!--webbot bot="Timestamp" endspan i-checksum="14936" --></p>
</body> </body>