lemon/bits/invalid.h
changeset 36 d6bc33fa6590
parent 7 4d461e9867da
child 39 0a01d811071f
equal deleted inserted replaced
0:e0e570e6bab5 1:252c8649a25e
    22 ///\file
    22 ///\file
    23 ///\brief Definition of INVALID.
    23 ///\brief Definition of INVALID.
    24 
    24 
    25 namespace lemon {
    25 namespace lemon {
    26 
    26 
    27   /// \brief Dummy type to make it easier to make invalid iterators.
    27   /// \brief Dummy type to make it easier to create invalid iterators.
    28   ///
    28   ///
    29   /// See \ref INVALID for the usage.
    29   /// See \ref INVALID for the usage.
    30   struct Invalid {
    30   struct Invalid {
    31   public:
    31   public:
    32     bool operator==(Invalid) { return true;  }
    32     bool operator==(Invalid) { return true;  }
    33     bool operator!=(Invalid) { return false; }
    33     bool operator!=(Invalid) { return false; }
    34     bool operator< (Invalid) { return false; }
    34     bool operator< (Invalid) { return false; }
    35   };
    35   };
    36   
    36   
    37   /// Invalid iterators.
    37   /// \brief Invalid iterators.
    38   
    38   ///
    39   /// \ref Invalid is a global type that converts to each iterator
    39   /// \ref Invalid is a global type that converts to each iterator
    40   /// in such a way that the value of the target iterator will be invalid.
    40   /// in such a way that the value of the target iterator will be invalid.
    41 
    41 
    42   //Some people didn't like this:
    42   //Some people didn't like this:
    43   //const Invalid &INVALID = *(Invalid *)0;
    43   //const Invalid &INVALID = *(Invalid *)0;