src/hugo/maps.h
changeset 890 3a48bc350e0f
parent 805 59b8cb2cb2f8
child 906 17f31d280385
     1.1 --- a/src/hugo/maps.h	Mon Sep 20 16:20:11 2004 +0000
     1.2 +++ b/src/hugo/maps.h	Mon Sep 20 17:53:33 2004 +0000
     1.3 @@ -76,7 +76,21 @@
     1.4      ConstMap(const ConstMap<K,T1> &, const T &_v) : v(_v) {}
     1.5    };
     1.6  
     1.7 -
     1.8 +  //to document later
     1.9 +  template<typename T, T v>
    1.10 +  struct Const { };
    1.11 +  //to document later
    1.12 +  template<typename K, typename V, V v>
    1.13 +  class ConstMap<K, Const<V, v> > : public MapBase<K, V>
    1.14 +  {
    1.15 +  public:
    1.16 +    ConstMap() { }
    1.17 +    V operator[](const K&) const { return v; }
    1.18 +    void set(const K&, const V&) { }
    1.19 +  };
    1.20 +  //to document later
    1.21 +  typedef Const<bool, true> True;
    1.22 +  typedef Const<bool, false> False;
    1.23  
    1.24    /// \c std::map wrapper
    1.25