src/work/deba/invalid.h
author alpar
Mon, 19 Jul 2004 13:29:32 +0000
changeset 706 0fe42b8ec5a6
child 921 818510fa3d99
permissions -rw-r--r--
Temporal change: public Edge constructor with given ID.
deba@701
     1
// -*- mode:C++ -*-
deba@701
     2
deba@701
     3
#ifndef HUGO_INVALID_H
deba@701
     4
#define HUGO_INVALID_H
deba@701
     5
deba@701
     6
///\file
deba@701
     7
///\brief Definition of INVALID.
deba@701
     8
deba@701
     9
namespace hugo {
deba@701
    10
deba@701
    11
  /// Dummy type to make it easier to make invalid iterators.
deba@701
    12
  
deba@701
    13
  /// See \ref INVALID, how to use it.
deba@701
    14
  
deba@701
    15
  struct Invalid {
deba@701
    16
  public:
deba@701
    17
    bool operator==(Invalid) { return true;  }
deba@701
    18
    bool operator!=(Invalid) { return false; }
deba@701
    19
    bool operator< (Invalid) { return false; }
deba@701
    20
  };
deba@701
    21
  
deba@701
    22
  /// Invalid iterators.
deba@701
    23
  
deba@701
    24
  /// \ref Invalid is a global type that converts to each iterator
deba@701
    25
  /// in such a way that the value of the target iterator will be invalid.
deba@701
    26
deba@701
    27
  // It is also used to convert the \c INVALID constant to the
deba@701
    28
  // node iterator that makes is possible to write 
deba@701
    29
deba@701
    30
  //extern Invalid INVALID;
deba@701
    31
deba@701
    32
  //const Invalid &INVALID = *(Invalid *)0;
deba@701
    33
  const Invalid INVALID = Invalid();
deba@701
    34
deba@701
    35
} //namespace hugo
deba@701
    36
deba@701
    37
#endif
deba@701
    38