From b86b99190bfa5a92df46721daa8bd9b0afdf43ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20J=C3=B8rgen=20Ottosen?= Date: Fri, 30 Jul 2004 02:56:01 +0000 Subject: [PATCH] *** empty log message *** [SVN r24176] --- doc/boost_range.html | 2 +- doc/range.htm | 3 + doc/style.html | 146 +++++++++++++++++++++++++++++++++++++++++ doc/utility_class.html | 9 ++- index.html | 23 +++---- 5 files changed, 162 insertions(+), 21 deletions(-) create mode 100755 doc/style.html diff --git a/doc/boost_range.html b/doc/boost_range.html index b92a786..7ee54ee 100644 --- a/doc/boost_range.html +++ b/doc/boost_range.html @@ -1,4 +1,4 @@ - Collection Traits


Collection Traits


Introduction

This library makes it possible to treat different types as if they have + Boost.Range External Range Implementation


Boost.Range External Range Implementation


Introduction

This library makes it possible to treat different types as if they have implemented a subset of the container requirements (see §23.1of the C++ standard). Formally, that subset is defined by the CollectionConcept. diff --git a/doc/range.htm b/doc/range.htm index 7819b69..2119e7a 100755 --- a/doc/range.htm +++ b/doc/range.htm @@ -20,6 +20,7 @@
+

Range

Description

@@ -439,8 +440,10 @@ An algorithm that iterates through the range [a.begin(), a.end())

+

ReversibleRange

+

Description

This concept provides access to iterators that traverse in both directions (forward and reverse). The iterator type must meet all of diff --git a/doc/style.html b/doc/style.html new file mode 100755 index 0000000..5dbace7 --- /dev/null +++ b/doc/style.html @@ -0,0 +1,146 @@ + + + + + +Boost.Range Terminology and Style Guidelines + + + + + + + + + + +
+

Boost.Range terminology and style guidelines

+
+ +

+ The use of a consistent terminologi is as important for + iterator Ranges and + ExternalRange-based algorithms + as it is for iterators and iterator-based algorithms. + If a conventional set of names are adopted, we can avoid misunderstandings + and write generic function prototypes that are self-documenting. +

+ +

+ Since iterator ranges are characterized by a specific underlying + iterator type, we get a type of iterator range for each type of + iterator. Hence we can speak of the following types of iterator + ranges: +

+ Notice how we have used the categories from the + new style iterators. + Similarly, for ExternalRange + we have + + The convention of using an X to mean "External" save us from +rediculously long parameter names and is easy to associate with an + external concept. + +

+ Notice that an interator (and therefore an iterator range) has + one traversal property and one or more properties from the + value access category. So in reality we will mostly talk about + mixtures such as

+ By convention, we should always specify the travelsal property first + as done above. This seems resonable since there will only be one + traversal property, but perhaps many value acccess properties. +

+ +

+ As an example, consider how we specify the interface of + std::sort(). The iterator-based version looks like + this: + +

+   template< class RandomAccessTraversalReadableWritableIterator >
+   void sort( RandomAccessTraversalReadableWritableIterator first,
+              RandomAccessTraversalReadableWritableIterator last );
+   
+ For external iterator ranges the interface becomes + +
+   template< class XRandomAccessReadableWritableRange >
+   void sort( XRandomAccessReadableWritableRange& r );
+   
+ Had the function been specified like + +
+   template< class RandomAccessReadableWritableRange >
+   void sort( RandomAccessReadableWritableRange& r );
+   
+ + we should expect the underlying code to call r.begin() + and r.end() to extract the iterators instead of + begin( r ) and end( r ). In general + it is much more flexible to rely on external iterator ranges + than iterator ranges. +

+

+ + +
+

+ (C) Copyright Thorsten Ottosen 2003-2004 +

+ +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + diff --git a/doc/utility_class.html b/doc/utility_class.html index 637cfad..d2db418 100644 --- a/doc/utility_class.html +++ b/doc/utility_class.html @@ -17,7 +17,6 @@ -

Having an abstraction that encapsulates a pair of iterators is very useful. The standard library uses std::pair in some @@ -29,8 +28,8 @@ whereas more domain specific class names are. Therefore these two classes are provided:

+
  • Class iterator_range +
  • Class sub_range The iterator_range class is templated on an iterator and should be @@ -40,7 +39,7 @@ and it is less general, but a bit easier to use since its template argument is easier to specify.

    -

    iterator_range

    +

    Class iterator_range

    The intention of the iterator_range class is to encapsulate @@ -137,7 +136,7 @@ client must ensure that the two iterators delimit a valid closed-open range


    -

    sub_range

    +

    Class sub_range

    The sub_range class inherits all its functionality from the iterator_range class. diff --git a/index.html b/index.html index 2bf64b7..a54591b 100755 --- a/index.html +++ b/index.html @@ -38,33 +38,26 @@
  • Concepts: -
  • Implementation of ExternalReversibleRange for - -
  • - Utility functions: - -
  • Style and terminology guidelines +
  • Terminology and style guidelines
  • Headers