1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/lemon/invalid.h Mon May 23 04:48:14 2005 +0000
1.3 @@ -0,0 +1,52 @@
1.4 +/* -*- C++ -*-
1.5 + * lemon/invalid.h - Part of LEMON, a generic C++ optimization library
1.6 + *
1.7 + * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.8 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.9 + *
1.10 + * Permission to use, modify and distribute this software is granted
1.11 + * provided that this copyright notice appears in all copies. For
1.12 + * precise terms see the accompanying LICENSE file.
1.13 + *
1.14 + * This software is provided "AS IS" with no warranty of any kind,
1.15 + * express or implied, and with no claim as to its suitability for any
1.16 + * purpose.
1.17 + *
1.18 + */
1.19 +
1.20 +#ifndef LEMON_INVALID_H
1.21 +#define LEMON_INVALID_H
1.22 +
1.23 +///\file
1.24 +///\brief Definition of INVALID.
1.25 +
1.26 +namespace lemon {
1.27 +
1.28 + /// Dummy type to make it easier to make invalid iterators.
1.29 +
1.30 + /// See \ref INVALID, how to use it.
1.31 +
1.32 + struct Invalid {
1.33 + public:
1.34 + bool operator==(Invalid) { return true; }
1.35 + bool operator!=(Invalid) { return false; }
1.36 + bool operator< (Invalid) { return false; }
1.37 + };
1.38 +
1.39 + /// Invalid iterators.
1.40 +
1.41 + /// \ref Invalid is a global type that converts to each iterator
1.42 + /// in such a way that the value of the target iterator will be invalid.
1.43 +
1.44 + // It is also used to convert the \c INVALID constant to the
1.45 + // node iterator that makes is possible to write
1.46 +
1.47 + //extern Invalid INVALID;
1.48 +
1.49 + //const Invalid &INVALID = *(Invalid *)0;
1.50 + const Invalid INVALID = Invalid();
1.51 +
1.52 +} //namespace lemon
1.53 +
1.54 +#endif
1.55 +