Lumiera  0.pre.03
»edit your freedom«
null-value.hpp
Go to the documentation of this file.
1 /*
2  NULL-VALUE.hpp - maintain per-type NIL values in static memory
3 
4  Copyright (C)
5  2010, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
49 #ifndef LIB_NULL_VALUE_H
50 #define LIB_NULL_VALUE_H
51 
52 
53 
54 namespace lib {
55 
61  template<class TY>
62  struct NullValue
63  {
64  static TY const&
65  get()
66  {
67  static TY nilValue;
68  return nilValue;
69  }
70  };
71 
72 
73 
74 } // namespace lib
75 #endif
Singleton holder for NIL or default value objects.
Definition: null-value.hpp:62
Implementation namespace for support and library code.