src/include/invalid.h
changeset 253 f45703336699
parent 242 b255f25ad394
child 389 770cc1f4861f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/include/invalid.h	Mon Mar 29 08:16:18 2004 +0000
     1.3 @@ -0,0 +1,33 @@
     1.4 +// -*- mode:C++ -*-
     1.5 +
     1.6 +#ifndef HUGO_INVALID_H
     1.7 +#define HUGO_INVALID_H
     1.8 +
     1.9 +///\file
    1.10 +///\brief Definition of INVALID.
    1.11 +
    1.12 +namespace hugo {
    1.13 +
    1.14 +  /// Dummy type to make it easier to make invalid iterators.
    1.15 +  
    1.16 +  /// See \ref INVALID, how to use it.
    1.17 +  
    1.18 +  struct Invalid {};
    1.19 +  
    1.20 +  /// Invalid iterators.
    1.21 +  
    1.22 +  /// \ref Invalid is a global type that converts to each iterator
    1.23 +  /// in such a way that the value of the target iterator will be invalid.
    1.24 +
    1.25 +  // It is also used to convert the \c INVALID constant to the
    1.26 +  // node iterator that makes is possible to write 
    1.27 +
    1.28 +  //extern Invalid INVALID;
    1.29 +
    1.30 +  //const Invalid &INVALID = *(Invalid *)0;
    1.31 +  const Invalid INVALID = Invalid();
    1.32 +
    1.33 +};
    1.34 +
    1.35 +#endif
    1.36 +