author | alpar |
Mon, 13 Sep 2004 11:24:35 +0000 | |
changeset 835 | eb9587f09b42 |
parent 412 | 5d48b6773b73 |
child 906 | 17f31d280385 |
permissions | -rw-r--r-- |
alpar@162 | 1 |
// -*- mode:C++ -*- |
alpar@162 | 2 |
|
alpar@162 | 3 |
#ifndef HUGO_INVALID_H |
alpar@162 | 4 |
#define HUGO_INVALID_H |
alpar@162 | 5 |
|
alpar@242 | 6 |
///\file |
alpar@242 | 7 |
///\brief Definition of INVALID. |
alpar@242 | 8 |
|
alpar@162 | 9 |
namespace hugo { |
alpar@162 | 10 |
|
alpar@162 | 11 |
/// Dummy type to make it easier to make invalid iterators. |
alpar@162 | 12 |
|
alpar@162 | 13 |
/// See \ref INVALID, how to use it. |
alpar@162 | 14 |
|
alpar@412 | 15 |
struct Invalid { |
alpar@412 | 16 |
public: |
alpar@412 | 17 |
bool operator==(Invalid) { return true; } |
alpar@412 | 18 |
bool operator!=(Invalid) { return false; } |
alpar@412 | 19 |
bool operator< (Invalid) { return false; } |
alpar@412 | 20 |
}; |
alpar@162 | 21 |
|
alpar@162 | 22 |
/// Invalid iterators. |
alpar@162 | 23 |
|
alpar@162 | 24 |
/// \ref Invalid is a global type that converts to each iterator |
alpar@162 | 25 |
/// in such a way that the value of the target iterator will be invalid. |
alpar@184 | 26 |
|
alpar@184 | 27 |
// It is also used to convert the \c INVALID constant to the |
alpar@184 | 28 |
// node iterator that makes is possible to write |
alpar@184 | 29 |
|
alpar@165 | 30 |
//extern Invalid INVALID; |
alpar@162 | 31 |
|
klao@169 | 32 |
//const Invalid &INVALID = *(Invalid *)0; |
klao@169 | 33 |
const Invalid INVALID = Invalid(); |
alpar@162 | 34 |
|
marci@389 | 35 |
} //namespace hugo |
alpar@162 | 36 |
|
alpar@162 | 37 |
#endif |
alpar@162 | 38 |