diff --git a/array.html b/array.html index 217283e..cd17aea 100644 --- a/array.html +++ b/array.html @@ -15,11 +15,14 @@ Wrapper) for Arrays of Constant Size -
The C++ Standard Template - Library STL as part of the C++ Standard Library provides a framework for processing - algorithms on different kind of containers. However, ordinary arrays don't provide - the interface of STL containers (although, they provide the iterator interface - of STL containers). +
[intro] + [interface] [discussion] + [code] +
The + C++ Standard Template Library STL as part of the C++ Standard Library provides + a framework for processing algorithms on different kind of containers. However, + ordinary arrays don't provide the interface of STL containers (although, they + provide the iterator interface of STL containers).
As replacement for ordinary arrays, the STL provides class vector<>. However, vector<> provides @@ -38,8 +41,8 @@ the essence of these approaches spiced with many feedback from boost.
After considering different names, we decided to name this class simply array. -
The class provides the - following interface: +
The + class provides the following interface:
Types: | @@ -127,7 +130,7 @@|
rend() | returns reverse iterator - for posistion behind last element of reverese iteration | + for position behind last element of reverse iteration
operator[i] | @@ -197,15 +200,15 @@ time
Class array fulfills most
- but not all of the requirements of "reversible containers" (see Section
- 23.1, [lib.container.requirements] of the C++ Standard). The reasons array is
- not an reversible STL container is because: Class
+ array fulfills most but not all of the requirements of "reversible containers"
+ (see Section 23.1, [lib.container.requirements] of the C++ Standard). The reasons
+ array is not an reversible STL container is because:
+
- No constructors are provided
- Elements may have an indetermined initial value (see below)
- swap() has no constant complexity
- size() is always constant, based on the second template argument of the type
- - The container provides no allocator support
+ - The container provides no allocator support
It doesn't fulfill the
requirements of a "sequence" (see Section 23.1.1, [lib.sequence.reqmts]
of the C++ Standard), except that The current implementation
- useus this approach. However, being able to have indetermined initial values
+ uses this approach. However, being able to have indeterminate initial values
is a big drawback. So, please give me some feedback, how useful you consider
this feature to be. This leads to the list of Open issues:
int data[] = { 1, 2, 3, 4 } array<int,5> x(data); or
- array<int,data> x; int data[] = { 1, 2,
+ 3, 4 } array<int,5>
+ x(data); or array<int,data>
+ x; 8.5.1 (11) of the Standard seem
- to allow it; however, gcc 2.95.2 printa warning message. 8.5.1 (11) of the Standard
+ seems to allow it; however, gcc 2.95.2 prints a warning message. I'd appreciate any constructive feedback.
- 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
- class.
- The code is provided "as is" without
- expressed or implied warranty.
+ I'd appreciate any constructive
+ feedback. 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 class.
+ The code is provided
+ "as is" without expressed or implied warranty.
array.hpp, the implementation
of array<>:
@@ -236,43 +239,45 @@
-
-
-
-
+
-
Simple Example for using array<>:
+ All files
+
+
To find more details about using ordinary arrays in C++ and the framework of
the STL, see e.g.
The C++
@@ -307,9 +317,14 @@
M. Josuttis
Addison Wesley Longman, 1999
ISBN 0-201-37926-0
-
+
Home
- Page of Nicolai Josuttis
-
+ Page of Nicolai Josuttis
+
+
[intro] + [interface] [discussion] + [code] +
+