mirror of
https://github.com/boostorg/array.git
synced 2025-07-13 20:56:33 +02:00
1.17.0 release candidate runup
[SVN r7683]
This commit is contained in:
315
array.hpp.html
315
array.hpp.html
@ -1,159 +1,162 @@
|
|||||||
<HTML>
|
<html>
|
||||||
<HEAD>
|
|
||||||
<TITLE>array.hpp</TITLE>
|
<head>
|
||||||
</HEAD>
|
<title>array.hpp</title>
|
||||||
|
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
|
||||||
|
<meta name="ProgId" content="FrontPage.Editor.Document">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body text="#000000" bgcolor="#FFFFFF">
|
||||||
|
|
||||||
<BODY TEXT="#000000" BGCOLOR="#FFFFFF">
|
|
||||||
|
|
||||||
<TABLE HEIGHT=40 WIDTH="100%">
|
<table height="40" width="100%">
|
||||||
<TR> <TD ALIGN=LEFT WIDTH="100%" BGCOLOR="#DDDDDD">
|
<tr>
|
||||||
<FONT face="Arial,Helvetica" size=+2><B>
|
<td align="LEFT" width="100%" bgcolor="#DDDDDD"><font face="Arial,Helvetica" size="+2"><b> array.hpp</b></font></td>
|
||||||
array.hpp
|
</tr>
|
||||||
</B></FONT>
|
</table>
|
||||||
</TD></TR></TABLE><BR>
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<tt><span class="Source"><font color="0000FF">/</font><i><font face="Arial,Helvetica,sans-serif" color="0000FF">* The following code declares class array,</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">* an STL container (as wrapper) for arrays of constant size.</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">*</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">* See</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">* http://www.josuttis.com/cppcode</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">* for details and the latest version.</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">*</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">* (C) Copyright Nicolai M. Josuttis 1999.</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">* Permission to copy, use, modify, sell and distribute this software</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">* is granted provided this copyright notice appears in all copies.</font></i><br>
|
||||||
|
<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">*/</font></i><br>
|
||||||
|
#ifndef BOOST_ARRAY_HPP<br>
|
||||||
|
#define BOOST_ARRAY_HPP<br>
|
||||||
|
<br>
|
||||||
|
#include <cstddef><br>
|
||||||
|
#include <stdexcept><br>
|
||||||
|
#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="../../boost/config.hpp">boost/config.hpp</a>><br>
|
||||||
|
<br>
|
||||||
|
namespace boost {<br>
|
||||||
|
<br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
class array {<br>
|
||||||
|
public:<br>
|
||||||
|
T elems[N]; <i><font face="Arial,Helvetica,sans-serif" color="0000FF">// fixed-size array of elements of type T</font></i><br>
|
||||||
|
<br>
|
||||||
|
public:<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// type definitions</font></i><br>
|
||||||
|
typedef T value_type;<br>
|
||||||
|
typedef T* iterator;<br>
|
||||||
|
typedef const T* const_iterator;<br>
|
||||||
|
typedef T& reference;<br>
|
||||||
|
typedef const T& const_reference;<br>
|
||||||
|
typedef std::size_t size_type;<br>
|
||||||
|
typedef std::ptrdiff_t difference_type;<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// iterator support</font></i><br>
|
||||||
|
iterator begin() { return elems; }<br>
|
||||||
|
const_iterator begin() const { return elems; }<br>
|
||||||
|
iterator end() { return elems+N; }<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>
|
||||||
|
typedef std::reverse_iterator<iterator> reverse_iterator;<br>
|
||||||
|
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;<br>
|
||||||
|
reverse_iterator rbegin() { return reverse_iterator(end()); }<br>
|
||||||
|
const_reverse_iterator rbegin() const {<br>
|
||||||
|
return const_reverse_iterator(end());<br>
|
||||||
|
}<br>
|
||||||
|
reverse_iterator rend() { return reverse_iterator(begin()); }<br>
|
||||||
|
const_reverse_iterator rend() const {<br>
|
||||||
|
return const_reverse_iterator(begin());<br>
|
||||||
|
}<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// operator[]</font></i><br>
|
||||||
|
reference operator[](size_type i) { return elems[i]; }<br>
|
||||||
|
const_reference operator[](size_type i) const { return elems[i]; }<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// at() with range check</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// note: rangecheck() is public because we have implemented array</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// as aggregate, which forbids non-public members</font></i><br>
|
||||||
|
void rangecheck (size_type i) const {<br>
|
||||||
|
if (i >= size()) { throw std::range_error("array"); }<br>
|
||||||
|
}<br>
|
||||||
|
reference at(size_type i) { rangecheck(i); return elems[i]; }<br>
|
||||||
|
const_reference at(size_type i) const { rangecheck(i); return elems[i]; }<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// front() and back()</font></i><br>
|
||||||
|
reference front() { return elems[0]; }<br>
|
||||||
|
const_reference front() const { return elems[0]; }<br>
|
||||||
|
reference back() { return elems[N-1]; }<br>
|
||||||
|
const_reference back() const { return elems[N-1]; }<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// size is constant</font></i><br>
|
||||||
|
static size_type size() { return N; }<br>
|
||||||
|
static bool empty() { return false; }<br>
|
||||||
|
static size_type max_size() { return N; }<br>
|
||||||
|
enum { static_size = N };<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// swap (note: linear complexity)</font></i><br>
|
||||||
|
void swap (array& y) {<br>
|
||||||
|
std::swap_ranges(begin(),end(),y.begin());<br>
|
||||||
|
}<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// direct access to data</font></i><br>
|
||||||
|
const T* data() const { return elems; }<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// assignment with type conversion</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">//template <typename T2></font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">//T& operator= (const array<T2,N>& rhs) {</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// std::copy (begin(),end(),rhs.begin());</font></i><br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">//}</font></i><br>
|
||||||
|
};<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// comparisons</font></i><br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
bool operator== (const array<T,N>& x, const array<T,N>& y) {<br>
|
||||||
|
return std::equal(x.begin(), x.end(), y.begin());<br>
|
||||||
|
}<br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
bool operator< (const array<T,N>& x, const array<T,N>& y) {<br>
|
||||||
|
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());<br>
|
||||||
|
}<br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
bool operator!= (const array<T,N>& x, const array<T,N>& y) {<br>
|
||||||
|
return !(x==y);<br>
|
||||||
|
}<br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
bool operator> (const array<T,N>& x, const array<T,N>& y) {<br>
|
||||||
|
return y<x;<br>
|
||||||
|
}<br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
bool operator<= (const array<T,N>& x, const array<T,N>& y) {<br>
|
||||||
|
return !(y<x);<br>
|
||||||
|
}<br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
bool operator>= (const array<T,N>& x, const array<T,N>& y) {<br>
|
||||||
|
return !(x<y);<br>
|
||||||
|
}<br>
|
||||||
|
<br>
|
||||||
|
<i><font face="Arial,Helvetica,sans-serif" color="0000FF">// global swap()</font></i><br>
|
||||||
|
template<class T, std::size_t N><br>
|
||||||
|
inline void swap (const array<T,N>& x, const array<T,N>& y) {<br>
|
||||||
|
x.swap(y);<br>
|
||||||
|
}<br>
|
||||||
|
<br>
|
||||||
|
} <i><font face="Arial,Helvetica,sans-serif" color="0000FF">/* namespace boost */</font></i><br>
|
||||||
|
<br>
|
||||||
|
#endif <i><font face="Arial,Helvetica,sans-serif" color="0000FF">/*BOOST_ARRAY_HPP*/</font></i><br>
|
||||||
|
</span></tt>
|
||||||
|
|
||||||
<BR><BR>
|
</body>
|
||||||
<TT>
|
|
||||||
<SPAN class="Source">
|
</html>
|
||||||
<Font color="0000FF" >/</FONT><I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* The following code declares class array,</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* an STL container (as wrapper) for arrays of constant size.</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >*</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* See</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* http://www.josuttis.com/cppcode</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* for details and the latest version.</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >*</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* (C) Copyright Nicolai M. Josuttis 1999.</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* Permission to copy, use, modify, sell and distribute this software</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >* is granted provided this copyright notice appears in all copies.</FONT></I><BR>
|
|
||||||
<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" >*/</FONT></I><BR>
|
|
||||||
#ifndef BOOST_ARRAY_HPP<BR>
|
|
||||||
#define BOOST_ARRAY_HPP<BR>
|
|
||||||
<BR>
|
|
||||||
#include <cstddef><BR>
|
|
||||||
#include <stdexcept><BR>
|
|
||||||
#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>
|
|
||||||
<BR>
|
|
||||||
namespace boost {<BR>
|
|
||||||
<BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
class array {<BR>
|
|
||||||
public:<BR>
|
|
||||||
T elems[N]; <I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// fixed-size array of elements of type T</FONT></I><BR>
|
|
||||||
<BR>
|
|
||||||
public:<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// type definitions</FONT></I><BR>
|
|
||||||
typedef T value_type;<BR>
|
|
||||||
typedef T* iterator;<BR>
|
|
||||||
typedef const T* const_iterator;<BR>
|
|
||||||
typedef T& reference;<BR>
|
|
||||||
typedef const T& const_reference;<BR>
|
|
||||||
typedef std::size_t size_type;<BR>
|
|
||||||
typedef std::ptrdiff_t difference_type;<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// iterator support</FONT></I><BR>
|
|
||||||
iterator begin() { return elems; }<BR>
|
|
||||||
const_iterator begin() const { return elems; }<BR>
|
|
||||||
iterator end() { return elems+N; }<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>
|
|
||||||
typedef std::reverse_iterator<iterator> reverse_iterator;<BR>
|
|
||||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;<BR>
|
|
||||||
reverse_iterator rbegin() { return reverse_iterator(end()); }<BR>
|
|
||||||
const_reverse_iterator rbegin() const {<BR>
|
|
||||||
return const_reverse_iterator(end());<BR>
|
|
||||||
}<BR>
|
|
||||||
reverse_iterator rend() { return reverse_iterator(begin()); }<BR>
|
|
||||||
const_reverse_iterator rend() const {<BR>
|
|
||||||
return const_reverse_iterator(begin());<BR>
|
|
||||||
}<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// operator[]</FONT></I><BR>
|
|
||||||
reference operator[](size_type i) { return elems[i]; }<BR>
|
|
||||||
const_reference operator[](size_type i) const { return elems[i]; }<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// at() with range check</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// note: rangecheck() is public because we have implemented array</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// as aggregate, which forbids non-public members</FONT></I><BR>
|
|
||||||
void rangecheck (size_type i) const {<BR>
|
|
||||||
if (i >= size()) { throw std::range_error("array"); }<BR>
|
|
||||||
}<BR>
|
|
||||||
reference at(size_type i) { rangecheck(i); return elems[i]; }<BR>
|
|
||||||
const_reference at(size_type i) const { rangecheck(i); return elems[i]; }<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// front() and back()</FONT></I><BR>
|
|
||||||
reference front() { return elems[0]; }<BR>
|
|
||||||
const_reference front() const { return elems[0]; }<BR>
|
|
||||||
reference back() { return elems[N-1]; }<BR>
|
|
||||||
const_reference back() const { return elems[N-1]; }<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// size is constant</FONT></I><BR>
|
|
||||||
static size_type size() { return N; }<BR>
|
|
||||||
static bool empty() { return false; }<BR>
|
|
||||||
static size_type max_size() { return N; }<BR>
|
|
||||||
enum { static_size = N };<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// swap (note: linear complexity)</FONT></I><BR>
|
|
||||||
void swap (array& y) {<BR>
|
|
||||||
std::swap_ranges(begin(),end(),y.begin());<BR>
|
|
||||||
}<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// direct access to data</FONT></I><BR>
|
|
||||||
const T* data() const { return elems; }<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// assignment with type conversion</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//template <typename T2></FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//T& operator= (const array<T2,N>& rhs) {</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// std::copy (begin(),end(),rhs.begin());</FONT></I><BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >//}</FONT></I><BR>
|
|
||||||
};<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// comparisons</FONT></I><BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
bool operator== (const array<T,N>& x, const array<T,N>& y) {<BR>
|
|
||||||
return std::equal(x.begin(), x.end(), y.begin());<BR>
|
|
||||||
}<BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
bool operator< (const array<T,N>& x, const array<T,N>& y) {<BR>
|
|
||||||
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());<BR>
|
|
||||||
}<BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
bool operator!= (const array<T,N>& x, const array<T,N>& y) {<BR>
|
|
||||||
return !(x==y);<BR>
|
|
||||||
}<BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
bool operator> (const array<T,N>& x, const array<T,N>& y) {<BR>
|
|
||||||
return y<x;<BR>
|
|
||||||
}<BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
bool operator<= (const array<T,N>& x, const array<T,N>& y) {<BR>
|
|
||||||
return !(y<x);<BR>
|
|
||||||
}<BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
bool operator>= (const array<T,N>& x, const array<T,N>& y) {<BR>
|
|
||||||
return !(x<y);<BR>
|
|
||||||
}<BR>
|
|
||||||
<BR>
|
|
||||||
<I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >// global swap()</FONT></I><BR>
|
|
||||||
template<class T, std::size_t N><BR>
|
|
||||||
inline void swap (const array<T,N>& x, const array<T,N>& y) {<BR>
|
|
||||||
x.swap(y);<BR>
|
|
||||||
}<BR>
|
|
||||||
<BR>
|
|
||||||
} <I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >/* namespace boost */</FONT></I><BR>
|
|
||||||
<BR>
|
|
||||||
#endif <I><FONT face="Arial,Helvetica,sans-serif" color="0000FF" >/*BOOST_ARRAY_HPP*/</FONT></I><BR>
|
|
||||||
</SPAN>
|
|
||||||
</TT>
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
||||||
|
284
array.htm
284
array.htm
@ -1,45 +1,50 @@
|
|||||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<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">
|
|
||||||
|
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<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="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"> </font>
|
|
||||||
|
<font face="Arial, Helvetica, sans-serif"><img border="0" src="../../c++boost.gif" width="277" height="86"> </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<></font>.
|
ordinary arrays, the STL provides class <font face="Courier New, Courier, mono">vector<></font>.
|
||||||
However, <font face="Courier New, Courier, mono">vector<></font> provides
|
However, <font face="Courier New, Courier, mono">vector<></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>
|
||||||
@ -56,17 +61,18 @@
|
|||||||
</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>
|
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="Courier New, Courier, mono" size="-1">reference</font></td>
|
||||||
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of element reference</font></td>
|
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of element
|
||||||
|
reference</font></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><font face="Courier New, Courier, mono" size="-1">const_reference</font></td>
|
<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
|
<td><font face="Arial, Helvetica, sans-serif" size="-1">type of element
|
||||||
that considers elements as being constant</font></td>
|
reference that considers elements as being constant</font></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
||||||
@ -95,8 +101,7 @@
|
|||||||
<td><font face="Courier New, Courier, mono" size="-1">array<<i>type</i>,<i>num</i>>(<i>a</i>)</font></td>
|
<td><font face="Courier New, Courier, mono" size="-1">array<<i>type</i>,<i>num</i>>(<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>
|
||||||
@ -116,13 +121,13 @@
|
|||||||
</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>
|
||||||
@ -133,13 +138,14 @@
|
|||||||
<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>
|
||||||
@ -158,13 +164,13 @@
|
|||||||
</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>
|
||||||
@ -188,127 +194,117 @@
|
|||||||
</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 "reversible containers" (see Section
|
but not all of the requirements of "reversible containers" (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 "sequence" (see Section 23.1.1, [lib.sequence.reqmts]
|
requirements of a "sequence" (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 "<b>aggregate</b>"
|
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 "<b>aggregate</b>" (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<int,4>
|
<p><font face="Arial, Helvetica, sans-serif" size="-1">boost::array<int,4>
|
||||||
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<int,5> x(data); <font face="Arial, Helvetica, sans-serif">or
|
<p><font face="Courier New, Courier, mono">array<int,5> x(data); <font face="Arial, Helvetica, sans-serif">or
|
||||||
</font> array<int,data> x;</font></p>
|
</font> array<int,data> x;</font></p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</li>
|
</li>
|
||||||
<li><font face="Arial, Helvetica, sans-serif">Could "<font face="Courier New, Courier, mono">{
|
<li><font face="Arial, Helvetica, sans-serif">Could "<font face="Courier New, Courier, mono">{
|
||||||
</font>...<font face="Courier New, Courier, mono"> }</font>" be used
|
</font>...<font face="Courier New, Courier, mono"> }</font>" be used
|
||||||
portably instead of "<font face="Courier New, Courier, mono">{ { </font>...<font face="Courier New, Courier, mono">
|
portably instead of "<font face="Courier New, Courier, mono">{ { </font>...<font face="Courier New, Courier, mono">
|
||||||
} }</font>" to initialize values?</font> </li>
|
} }</font>" to initialize values?</font></li>
|
||||||
<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></li>
|
iterator stuff?</font></li>
|
||||||
<li><font face="Arial, Helvetica, sans-serif">Template assignment operator (how
|
<li><font face="Arial, Helvetica, sans-serif">Template assignment operator
|
||||||
to implement?)</font></li>
|
(how to implement?)</font></li>
|
||||||
<li><font face="Arial, Helvetica, sans-serif">assign() member function?</font></li>
|
<li><font face="Arial, Helvetica, sans-serif">assign() member function?</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 "as
|
||||||
expressed or implied warranty.</font>
|
is" 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<></font><b>:</b> </font>
|
implementation of <font face="Courier New, Courier, mono">array<></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<><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<><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<><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<><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<><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<><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<></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> <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
|
by <a href="http://www.josuttis.com" target="_top">Nicolai
|
||||||
of <font face="Courier New, Courier, mono">array<></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
|
Addison Wesley Longman, 1999</font><font face="Arial, Helvetica, sans-serif"><br>
|
||||||
file</a></font></li>
|
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>
|
</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> <a href="http://www.josuttis.com/libbook/">The C++
|
|
||||||
Standard Library - A Tutorial and Reference</a></i> <br>
|
|
||||||
by <a href="http://www.josuttis.com" target="_top">Nicolai
|
|
||||||
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>
|
|
||||||
<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>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user