alpar@2655: /* -*- C++ -*- alpar@2655: * alpar@2655: * This file is a part of LEMON, a generic C++ optimization library alpar@2655: * alpar@2655: * Copyright (C) 2003-2006 alpar@2655: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@2655: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@2655: * alpar@2655: * Permission to use, modify and distribute this software is granted alpar@2655: * provided that this copyright notice appears in all copies. For alpar@2655: * precise terms see the accompanying LICENSE file. alpar@2655: * alpar@2655: * This software is provided "AS IS" with no warranty of any kind, alpar@2655: * express or implied, and with no claim as to its suitability for any alpar@2655: * purpose. alpar@2655: * alpar@2655: */ alpar@2655: alpar@2655: #ifndef LEMON_BITS_INVALID_H alpar@2655: #define LEMON_BITS_INVALID_H alpar@2655: alpar@2655: ///\file alpar@2655: ///\brief Definition of INVALID. alpar@2655: alpar@2655: namespace lemon { alpar@2655: alpar@2655: /// \brief Dummy type to make it easier to make invalid iterators. alpar@2655: /// alpar@2655: /// See \ref INVALID for the usage. alpar@2655: struct Invalid { alpar@2655: public: alpar@2655: bool operator==(Invalid) { return true; } alpar@2655: bool operator!=(Invalid) { return false; } alpar@2655: bool operator< (Invalid) { return false; } alpar@2655: }; alpar@2655: alpar@2655: /// Invalid iterators. alpar@2655: alpar@2655: /// \ref Invalid is a global type that converts to each iterator alpar@2655: /// in such a way that the value of the target iterator will be invalid. alpar@2655: alpar@2655: //Some people didn't like this: alpar@2655: //const Invalid &INVALID = *(Invalid *)0; alpar@2655: alpar@2655: #ifdef LEMON_ONLY_TEMPLATES alpar@2655: const Invalid INVALID = Invalid(); alpar@2655: #else alpar@2655: extern const Invalid INVALID; alpar@2655: #endif alpar@2655: alpar@2655: } //namespace lemon alpar@2655: alpar@2655: #endif alpar@2655: