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: @@ -127,7 +130,7 @@ + for position behind last element of reverse iteration @@ -197,15 +200,15 @@ time
Types:
rend() returns reverse iterator - for posistion behind last element of reverese iteration
operator[i]
-

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
@@ -236,43 +239,45 @@

  • It has no virtual functions.
  • 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:

    -

    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<>:

  • as HTML file
  • - as plain file
  • + as plain file

    Simple Example for using array<>:

  • as HTML file
  • @@ -298,7 +303,12 @@
  • as HTML file
  • as plain file
  • -

    +

    All files +

  • as ZIP file + (24KB)
  • +
  • as TGZ file + (13KB)
    +
    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] +

    +

      diff --git a/array1.cpp b/array1.cpp index e2be664..31639bb 100644 --- a/array1.cpp +++ b/array1.cpp @@ -42,5 +42,6 @@ int main() std::cout << "copy construction and copy assignment FAILED" << std::endl; } + return 0; } diff --git a/array2.cpp b/array2.cpp index bc0045e..ef7ed17 100644 --- a/array2.cpp +++ b/array2.cpp @@ -29,5 +29,6 @@ int main() a.begin(), // destination negate()); // operation PRINT_ELEMENTS(a); + return 0; } diff --git a/array3.cpp b/array3.cpp index 9c89caf..0bb2a85 100644 --- a/array3.cpp +++ b/array3.cpp @@ -35,6 +35,7 @@ int main() std::cout << " " << *pos; } std::cout << std::endl; + return 0; } template diff --git a/array4.cpp b/array4.cpp index 0820cde..80884fd 100644 --- a/array4.cpp +++ b/array4.cpp @@ -32,5 +32,6 @@ int main() std::cout << "last element of last array: " << seasons_i18n[seasons_i18n.size()-1][seasons_i18n[0].size()-1] << std::endl; + return 0; } diff --git a/array5.cpp b/array5.cpp index f9c1b92..235a633 100644 --- a/array5.cpp +++ b/array5.cpp @@ -60,5 +60,6 @@ int main() DArray da; da = ia; da.assign(42); + return 0; }