Next: Basic concepts
Up: GTL
Previous: GTL
Concepts Definitions
This is the thorough definition the concepts used by
GsTL algorithms.
The different fields of the description are the following:
- Refinement of:
- concept B is said to be a refinement of concept A if the requirements of A are a subset of the requirements of B. Consider the example of a Forward Iterator. A forward iterator is an object that points to other objects. It is used to iterate over a range of objects, in a single direction: it does not allow to go backward. The concept of Forward Iterator hence requires an operator ++ to advance to the next object of the range, an operator * which allows access to the value the iterator is pointing to, an operator != to compare two iterators, and an operator = which assigns an iterator to another. A Bidirectional Iterator is an iterator which allows to iterate over a range of objects in both forward and backward directions. It thus requires the same four operators as Forward Iterator, plus operator -, which moves the iterator to the previous object in the range. Since the requirements of Forward Iterator are a subset of the requirements of Bidirectional Iterator, Bidirectional Iterator is a refinement of a Forward Iterator.
Following this definition, if concept B is a refinement of concept A, any model of B is also a model of A.
- Associated types:
- a list of C++ types associated to the concept
- Notations:
- some notations used in the remaining of the description of the concept
- Valid expressions:
- a list of expressions that can be applied to a model of the concept. For instance, if iter is a model of the afore-mentioned Forward Iterator concept, such valid expression could be iter++ or *iter.
- Models:
- some examples of models of the concept.
Subsections
Next: Basic concepts
Up: GTL
Previous: GTL
nicolas
2002-05-07