lemon/invalid.h
author alpar
Wed, 01 Feb 2006 11:33:16 +0000
changeset 1937 7a7a1f95cc24
parent 1836 1fee7c6b5129
child 1956 a055123339d5
permissions -rw-r--r--
Some useful scripts:
check-compiler: test whether the repo compiles warningless
with various compilers.
check-integrity: checks whether everything is svn-added,
the makefiles are correct etc.
release: creates a version numbered release. Is modifies the repository.
DO NOT PLAY WITH IT!
     1 /* -*- C++ -*-
     2  * lemon/invalid.h - Part of LEMON, a generic C++ optimization library
     3  *
     4  * Copyright (C) 2006 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     6  *
     7  * Permission to use, modify and distribute this software is granted
     8  * provided that this copyright notice appears in all copies. For
     9  * precise terms see the accompanying LICENSE file.
    10  *
    11  * This software is provided "AS IS" with no warranty of any kind,
    12  * express or implied, and with no claim as to its suitability for any
    13  * purpose.
    14  *
    15  */
    16 
    17 #ifndef LEMON_INVALID_H
    18 #define LEMON_INVALID_H
    19 
    20 ///\file
    21 ///\brief Definition of INVALID.
    22 
    23 namespace lemon {
    24 
    25   /// Dummy type to make it easier to make invalid iterators.
    26   
    27   /// See \ref INVALID, how to use it.
    28   
    29   struct Invalid {
    30   public:
    31     bool operator==(Invalid) { return true;  }
    32     bool operator!=(Invalid) { return false; }
    33     bool operator< (Invalid) { return false; }
    34   };
    35   
    36   /// Invalid iterators.
    37   
    38   /// \ref Invalid is a global type that converts to each iterator
    39   /// in such a way that the value of the target iterator will be invalid.
    40 
    41   //const Invalid &INVALID = *(Invalid *)0;
    42 
    43 #ifdef LEMON_ONLY_TEMPLATES
    44   const Invalid INVALID = Invalid();
    45 #else
    46   extern const Invalid INVALID;
    47 #endif
    48 
    49 } //namespace lemon
    50 
    51 #endif
    52