src/hugo/invalid.h
author alpar
Thu, 23 Sep 2004 15:05:20 +0000
changeset 906 17f31d280385
parent 539 fb261e3a9a0f
permissions -rw-r--r--
Copyright header added.
alpar@906
     1
/* -*- C++ -*-
alpar@906
     2
 * src/hugo/invalid.h - Part of HUGOlib, a generic C++ optimization library
alpar@906
     3
 *
alpar@906
     4
 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@906
     5
 * (Egervary Combinatorial Optimization Research Group, EGRES).
alpar@906
     6
 *
alpar@906
     7
 * Permission to use, modify and distribute this software is granted
alpar@906
     8
 * provided that this copyright notice appears in all copies. For
alpar@906
     9
 * precise terms see the accompanying LICENSE file.
alpar@906
    10
 *
alpar@906
    11
 * This software is provided "AS IS" with no warranty of any kind,
alpar@906
    12
 * express or implied, and with no claim as to its suitability for any
alpar@906
    13
 * purpose.
alpar@906
    14
 *
alpar@906
    15
 */
alpar@162
    16
alpar@162
    17
#ifndef HUGO_INVALID_H
alpar@162
    18
#define HUGO_INVALID_H
alpar@162
    19
alpar@242
    20
///\file
alpar@242
    21
///\brief Definition of INVALID.
alpar@242
    22
alpar@162
    23
namespace hugo {
alpar@162
    24
alpar@162
    25
  /// Dummy type to make it easier to make invalid iterators.
alpar@162
    26
  
alpar@162
    27
  /// See \ref INVALID, how to use it.
alpar@162
    28
  
alpar@412
    29
  struct Invalid {
alpar@412
    30
  public:
alpar@412
    31
    bool operator==(Invalid) { return true;  }
alpar@412
    32
    bool operator!=(Invalid) { return false; }
alpar@412
    33
    bool operator< (Invalid) { return false; }
alpar@412
    34
  };
alpar@162
    35
  
alpar@162
    36
  /// Invalid iterators.
alpar@162
    37
  
alpar@162
    38
  /// \ref Invalid is a global type that converts to each iterator
alpar@162
    39
  /// in such a way that the value of the target iterator will be invalid.
alpar@184
    40
alpar@184
    41
  // It is also used to convert the \c INVALID constant to the
alpar@184
    42
  // node iterator that makes is possible to write 
alpar@184
    43
alpar@165
    44
  //extern Invalid INVALID;
alpar@162
    45
klao@169
    46
  //const Invalid &INVALID = *(Invalid *)0;
klao@169
    47
  const Invalid INVALID = Invalid();
alpar@162
    48
marci@389
    49
} //namespace hugo
alpar@162
    50
alpar@162
    51
#endif
alpar@162
    52