mirror of
https://github.com/boostorg/array.git
synced 2025-06-25 20:11:45 +02:00
Compare commits
7 Commits
svn-branch
...
boost-1.18
Author | SHA1 | Date | |
---|---|---|---|
23798f7b84 | |||
debb0f0908 | |||
52dadb9764 | |||
b62e1aa4e7 | |||
8c5daba6b3 | |||
6533fa4606 | |||
e3d87e942c |
@ -28,7 +28,7 @@
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* This software is provided "as is" without express or implied</FONT></I><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* warranty, and with no claim as to its suitability for any purpose.</FONT></I><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >*</FONT></I><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* Jul 31, 2000</FONT></I><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* Sep 29, 2000</FONT></I><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >*/</FONT></I><BR>
|
||||
#ifndef BOOST_ARRAY_HPP<BR>
|
||||
#define BOOST_ARRAY_HPP<BR>
|
||||
@ -38,10 +38,8 @@
|
||||
#include <iterator><BR>
|
||||
#include <algorithm><BR>
|
||||
<BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// BUG-FIX for compilers that don't support</FONT></I><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// std::size_t and std::ptrdiff_t yet</FONT></I><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// (such as gcc)</FONT></I><BR>
|
||||
#include <<A href="./config.hpp.html">boost/config.hpp</A>><BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// FIXES for broken compilers</FONT></I><BR>
|
||||
#include <<A href="../../boost/config.hpp"><A href="http://www.boost.org/boost/config.hpp">boost/config.hpp</A></A>><BR>
|
||||
<BR>
|
||||
namespace boost {<BR>
|
||||
<BR>
|
||||
@ -67,8 +65,15 @@ namespace boost {<BR>
|
||||
const_iterator end() const { return elems+N; }<BR>
|
||||
<BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// reverse iterator support</FONT></I><BR>
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)<BR>
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;<BR>
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;<BR>
|
||||
#else<BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// workaround for broken reverse_iterator implementations due to no partial specialization</FONT></I><BR>
|
||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;<BR>
|
||||
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;<BR>
|
||||
#endif<BR>
|
||||
<BR>
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }<BR>
|
||||
const_reverse_iterator rbegin() const {<BR>
|
||||
return const_reverse_iterator(end());<BR>
|
||||
@ -98,7 +103,6 @@ namespace boost {<BR>
|
||||
static size_type max_size() { return N; }<BR>
|
||||
enum { static_size = N };<BR>
|
||||
<BR>
|
||||
public:<BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// swap (note: linear complexity)</FONT></I><BR>
|
||||
void swap (array<T,N>& y) {<BR>
|
||||
std::swap_ranges(begin(),end(),y.begin());<BR>
|
||||
@ -120,7 +124,9 @@ namespace boost {<BR>
|
||||
std::fill_n(begin(),size(),value);<BR>
|
||||
}<BR>
|
||||
<BR>
|
||||
#ifndef BOOST_NO_PRIVATE_IN_AGGREGATE<BR>
|
||||
private:<BR>
|
||||
#endif<BR>
|
||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// check range (may be private because it is static)</FONT></I><BR>
|
||||
static void rangecheck (size_type i) {<BR>
|
||||
if (i >= size()) { throw std::range_error("array"); }<BR>
|
||||
|
11
array.html
11
array.html
@ -272,7 +272,7 @@
|
||||
<li><font face="Arial, Helvetica, sans-serif">
|
||||
<a href="array.hpp.html">as HTML file</a></font></li>
|
||||
<li><font face="Arial, Helvetica, sans-serif">
|
||||
<a href="array.hpp">as plain file</a></font></li>
|
||||
<a href="../../boost/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<><font face="Arial, Helvetica, sans-serif">:</font></font></font>
|
||||
<li><font face="Arial, Helvetica, sans-serif">
|
||||
<a href="array1.cpp.html">as HTML file</a></font> </li>
|
||||
@ -298,12 +298,7 @@
|
||||
<li><font face="Arial, Helvetica, sans-serif"> <a href="array5.cpp.html">as HTML
|
||||
file</a></font></li>
|
||||
<li><font face="Arial, Helvetica, sans-serif"> <a href="array5.cpp">as plain file</a></font></li>
|
||||
<p><b><font face="Arial, Helvetica, sans-serif">All files</font></b>
|
||||
<li><font face="Arial, Helvetica, sans-serif"> <a href="array.zip">as ZIP file
|
||||
(24KB)</a></font></li>
|
||||
<li><font face="Arial, Helvetica, sans-serif"> <a href="array.tgz">as TGZ file
|
||||
(13KB)</a><br>
|
||||
<br>
|
||||
<p><font face="Arial, Helvetica, sans-serif">
|
||||
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> <a href="http://www.josuttis.com/libbook/">The C++
|
||||
@ -312,7 +307,7 @@
|
||||
M. Josuttis</a></font> <font face="Arial, Helvetica, sans-serif"><br>
|
||||
Addison Wesley Longman, 1999</font> <font face="Arial, Helvetica, sans-serif"><br>
|
||||
ISBN 0-201-37926-0</font> <font face="Arial, Helvetica, sans-serif"><br>
|
||||
</font></li>
|
||||
</font>
|
||||
<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>
|
||||
</font>
|
||||
|
@ -39,7 +39,7 @@ int main()
|
||||
<< std::endl;
|
||||
}
|
||||
else {
|
||||
std::cout << "copy construction and copy assignment are OK"
|
||||
std::cout << "copy construction and copy assignment FAILED"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ int main()<BR>
|
||||
<< std::endl;<BR>
|
||||
}<BR>
|
||||
else {<BR>
|
||||
std::cout << "copy construction and copy assignment are OK"<BR>
|
||||
std::cout << "copy construction and copy assignment FAILED"<BR>
|
||||
<< std::endl;<BR>
|
||||
}<BR>
|
||||
}<BR>
|
||||
|
@ -11,7 +11,7 @@
|
||||
* This software is provided "as is" without express or implied
|
||||
* warranty, and with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* Jul 31, 2000
|
||||
* Sep 29, 2000
|
||||
*/
|
||||
#ifndef BOOST_ARRAY_HPP
|
||||
#define BOOST_ARRAY_HPP
|
||||
@ -21,9 +21,7 @@
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
|
||||
// BUG-FIX for compilers that don't support
|
||||
// std::size_t and std::ptrdiff_t yet
|
||||
// (such as gcc)
|
||||
// FIXES for broken compilers
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
@ -50,14 +48,14 @@ namespace boost {
|
||||
const_iterator end() const { return elems+N; }
|
||||
|
||||
// reverse iterator support
|
||||
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
# else
|
||||
#else
|
||||
// workaround for broken reverse_iterator implementations due to no partial specialization
|
||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const {
|
||||
@ -88,7 +86,6 @@ namespace boost {
|
||||
static size_type max_size() { return N; }
|
||||
enum { static_size = N };
|
||||
|
||||
public:
|
||||
// swap (note: linear complexity)
|
||||
void swap (array<T,N>& y) {
|
||||
std::swap_ranges(begin(),end(),y.begin());
|
||||
@ -110,10 +107,10 @@ namespace boost {
|
||||
std::fill_n(begin(),size(),value);
|
||||
}
|
||||
|
||||
# ifndef BOOST_NO_PRIVATE_IN_AGGREGATE
|
||||
#ifndef BOOST_NO_PRIVATE_IN_AGGREGATE
|
||||
private:
|
||||
# endif
|
||||
// private member functions are allowed in aggregates [ISO 8.5.1]
|
||||
#endif
|
||||
// check range (may be private because it is static)
|
||||
static void rangecheck (size_type i) {
|
||||
if (i >= size()) { throw std::range_error("array"); }
|
||||
}
|
||||
|
@ -13,8 +13,8 @@
|
||||
<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 face="Arial" color="#FFFFFF"><big>Home</big></font></a></td>
|
||||
<td><a href="../../libraries.htm"><font face="Arial" color="#FFFFFF"><big>Libraries</big></font></a></td>
|
||||
<td><a href="../../people.htm"><font face="Arial" color="#FFFFFF"><big>People</big></font></a></td>
|
||||
<td><a href="../libraries.htm"><font face="Arial" color="#FFFFFF"><big>Libraries</big></font></a></td>
|
||||
<td><a href="../../people/people.htm"><font face="Arial" color="#FFFFFF"><big>People</big></font></a></td>
|
||||
<td><a href="../../more/faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ</big></font></a></td>
|
||||
<td><a href="../../more/index.htm"><font face="Arial" color="#FFFFFF"><big>More</big></font></a></td>
|
||||
</tr>
|
||||
@ -23,13 +23,13 @@
|
||||
<p>The header array.hpp provides an STL compliant container wrapper for arrays
|
||||
of constant size.
|
||||
<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>See docs for links to example programs.</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>
|
||||
</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 -->10 Nov 2000<!--webbot bot="Timestamp" endspan i-checksum="15233" --></p>
|
||||
|
||||
</body>
|
||||
|
||||
|
Reference in New Issue
Block a user