author | alpar |
Wed, 12 Jul 2006 11:14:12 +0000 | |
changeset 2134 | 914602e294be |
child 2140 | c123ac9928db |
permissions | -rw-r--r-- |
deba@1993 | 1 |
/* -*- C++ -*- |
deba@1993 | 2 |
* |
deba@1993 | 3 |
* This file is a part of LEMON, a generic C++ optimization library |
deba@1993 | 4 |
* |
deba@1993 | 5 |
* Copyright (C) 2003-2006 |
deba@1993 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
deba@1993 | 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
deba@1993 | 8 |
* |
deba@1993 | 9 |
* Permission to use, modify and distribute this software is granted |
deba@1993 | 10 |
* provided that this copyright notice appears in all copies. For |
deba@1993 | 11 |
* precise terms see the accompanying LICENSE file. |
deba@1993 | 12 |
* |
deba@1993 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
deba@1993 | 14 |
* express or implied, and with no claim as to its suitability for any |
deba@1993 | 15 |
* purpose. |
deba@1993 | 16 |
* |
deba@1993 | 17 |
*/ |
deba@1993 | 18 |
|
deba@1993 | 19 |
#ifndef LEMON_BITS_INVALID_H |
deba@1993 | 20 |
#define LEMON_BITS_INVALID_H |
deba@1993 | 21 |
|
deba@1993 | 22 |
///\file |
deba@1993 | 23 |
///\brief Definition of INVALID. |
deba@1993 | 24 |
|
deba@1993 | 25 |
namespace lemon { |
deba@1993 | 26 |
|
deba@1993 | 27 |
/// Dummy type to make it easier to make invalid iterators. |
deba@1993 | 28 |
|
deba@1993 | 29 |
/// See \ref INVALID, how to use it. |
deba@1993 | 30 |
|
deba@1993 | 31 |
struct Invalid { |
deba@1993 | 32 |
public: |
deba@1993 | 33 |
bool operator==(Invalid) { return true; } |
deba@1993 | 34 |
bool operator!=(Invalid) { return false; } |
deba@1993 | 35 |
bool operator< (Invalid) { return false; } |
deba@1993 | 36 |
}; |
deba@1993 | 37 |
|
deba@1993 | 38 |
/// Invalid iterators. |
deba@1993 | 39 |
|
deba@1993 | 40 |
/// \ref Invalid is a global type that converts to each iterator |
deba@1993 | 41 |
/// in such a way that the value of the target iterator will be invalid. |
deba@1993 | 42 |
|
deba@1993 | 43 |
//const Invalid &INVALID = *(Invalid *)0; |
deba@1993 | 44 |
|
deba@1993 | 45 |
#ifdef LEMON_ONLY_TEMPLATES |
deba@1993 | 46 |
const Invalid INVALID = Invalid(); |
deba@1993 | 47 |
#else |
deba@1993 | 48 |
extern const Invalid INVALID; |
deba@1993 | 49 |
#endif |
deba@1993 | 50 |
|
deba@1993 | 51 |
} //namespace lemon |
deba@1993 | 52 |
|
deba@1993 | 53 |
#endif |
deba@1993 | 54 |