lemon/maps.h
changeset 1705 3f63d9db307b
parent 1695 e6f99fe1723f
child 1725 22752dd6c693
     1.1 --- a/lemon/maps.h	Wed Oct 05 13:17:42 2005 +0000
     1.2 +++ b/lemon/maps.h	Wed Oct 05 13:18:51 2005 +0000
     1.3 @@ -38,11 +38,9 @@
     1.4  
     1.5    /// Base class of maps.
     1.6    /// It provides the necessary <tt>typedef</tt>s required by the map concept.
     1.7 -  template<typename K, typename T, typename _NeedCopy = False>
     1.8 +  template<typename K, typename T>
     1.9    class MapBase {
    1.10    public:
    1.11 -    /// \e
    1.12 -    typedef _NeedCopy NeedCopy;
    1.13      ///\e
    1.14      typedef K Key;
    1.15      ///\e
    1.16 @@ -54,10 +52,10 @@
    1.17    /// If you have to provide a map only for its type definitions,
    1.18    /// or if you have to provide a writable map, but
    1.19    /// data written to it will sent to <tt>/dev/null</tt>...
    1.20 -  template<typename K, typename T, typename NC = False>
    1.21 -  class NullMap : public MapBase<K, T, NC> {
    1.22 +  template<typename K, typename T>
    1.23 +  class NullMap : public MapBase<K, T> {
    1.24    public:
    1.25 -    typedef MapBase<K, T, NC> Parent;
    1.26 +    typedef MapBase<K, T> Parent;
    1.27      typedef typename Parent::Key Key;
    1.28      typedef typename Parent::Value Value;
    1.29      
    1.30 @@ -68,8 +66,8 @@
    1.31    };
    1.32  
    1.33    template <typename K, typename V> 
    1.34 -  NullMap<K, V, True> nullMap() {
    1.35 -    return NullMap<K, V, True>();
    1.36 +  NullMap<K, V> nullMap() {
    1.37 +    return NullMap<K, V>();
    1.38    }
    1.39  
    1.40  
    1.41 @@ -78,13 +76,13 @@
    1.42    /// This is a readable map which assigns a specified value to each key.
    1.43    /// In other aspects it is equivalent to the \ref NullMap.
    1.44    /// \todo set could be used to set the value.
    1.45 -  template<typename K, typename T, typename NC = False>
    1.46 -  class ConstMap : public MapBase<K, T, NC> {
    1.47 +  template<typename K, typename T>
    1.48 +  class ConstMap : public MapBase<K, T> {
    1.49    private:
    1.50      T v;
    1.51    public:
    1.52  
    1.53 -    typedef MapBase<K, T, NC> Parent;
    1.54 +    typedef MapBase<K, T> Parent;
    1.55      typedef typename Parent::Key Key;
    1.56      typedef typename Parent::Value Value;
    1.57  
    1.58 @@ -116,8 +114,8 @@
    1.59    ///This function just returns a \ref ConstMap class.
    1.60    ///\relates ConstMap
    1.61    template<typename K, typename V> 
    1.62 -  inline ConstMap<K, V, True> constMap(const V &v) {
    1.63 -    return ConstMap<K, V, True>(v);
    1.64 +  inline ConstMap<K, V> constMap(const V &v) {
    1.65 +    return ConstMap<K, V>(v);
    1.66    }
    1.67  
    1.68  
    1.69 @@ -126,10 +124,10 @@
    1.70    struct Const { };
    1.71  
    1.72    //\todo to document later
    1.73 -  template<typename K, typename V, V v, typename NC>
    1.74 -  class ConstMap<K, Const<V, v>, NC > : public MapBase<K, V, NC> {
    1.75 +  template<typename K, typename V, V v>
    1.76 +  class ConstMap<K, Const<V, v> > : public MapBase<K, V> {
    1.77    public:
    1.78 -    typedef MapBase<K, V, False> Parent;
    1.79 +    typedef MapBase<K, V> Parent;
    1.80      typedef typename Parent::Key Key;
    1.81      typedef typename Parent::Value Value;
    1.82  
    1.83 @@ -143,8 +141,8 @@
    1.84    ///This function just returns a \ref ConstMap class.
    1.85    ///\relates ConstMap
    1.86    template<typename K, typename V, V v> 
    1.87 -  inline ConstMap<K, Const<V, v>, True> constMap() {
    1.88 -    return ConstMap<K, Const<V, v>, True>();
    1.89 +  inline ConstMap<K, Const<V, v> > constMap() {
    1.90 +    return ConstMap<K, Const<V, v> >();
    1.91    }
    1.92  
    1.93    /// \c std::map wrapper
    1.94 @@ -225,10 +223,10 @@
    1.95    ///
    1.96    /// This mapping gives back the given key as value without any
    1.97    /// modification. 
    1.98 -  template <typename T, typename NC = False>
    1.99 -  class IdentityMap : public MapBase<T, T, NC> {
   1.100 +  template <typename T>
   1.101 +  class IdentityMap : public MapBase<T, T> {
   1.102    public:
   1.103 -    typedef MapBase<T, T, NC> Parent;
   1.104 +    typedef MapBase<T, T> Parent;
   1.105      typedef typename Parent::Key Key;
   1.106      typedef typename Parent::Value Value;
   1.107  
   1.108 @@ -242,8 +240,8 @@
   1.109    ///This function just returns an \ref IdentityMap class.
   1.110    ///\relates IdentityMap
   1.111    template<typename T>
   1.112 -  inline IdentityMap<T, True> identityMap() {
   1.113 -    return IdentityMap<T, True>();
   1.114 +  inline IdentityMap<T> identityMap() {
   1.115 +    return IdentityMap<T>();
   1.116    }
   1.117    
   1.118  
   1.119 @@ -252,11 +250,11 @@
   1.120    ///This \ref concept::ReadMap "read only map"
   1.121    ///converts the \c Value of a maps to type \c T.
   1.122    ///Its \c Key is inherited from \c M.
   1.123 -  template <typename M, typename T, typename NC = False> 
   1.124 -  class ConvertMap : public MapBase<typename M::Key, T, NC> {
   1.125 -    typename SmartConstReference<M>::Type m;
   1.126 +  template <typename M, typename T> 
   1.127 +  class ConvertMap : public MapBase<typename M::Key, T> {
   1.128 +    const M& m;
   1.129    public:
   1.130 -    typedef MapBase<typename M::Key, T, NC> Parent;
   1.131 +    typedef MapBase<typename M::Key, T> Parent;
   1.132      typedef typename Parent::Key Key;
   1.133      typedef typename Parent::Value Value;
   1.134  
   1.135 @@ -280,8 +278,8 @@
   1.136    ///\relates ConvertMap
   1.137    ///\todo The order of the template parameters are changed.
   1.138    template<typename T, typename M>
   1.139 -  inline ConvertMap<M, T, True> convertMap(const M &m) {
   1.140 -    return ConvertMap<M, T, True>(m);
   1.141 +  inline ConvertMap<M, T> convertMap(const M &m) {
   1.142 +    return ConvertMap<M, T>(m);
   1.143    }
   1.144  
   1.145    ///Sum of two maps
   1.146 @@ -290,13 +288,13 @@
   1.147    ///given maps. Its \c Key and \c Value will be inherited from \c M1.
   1.148    ///The \c Key and \c Value of M2 must be convertible to those of \c M1.
   1.149  
   1.150 -  template<typename M1, typename M2, typename NC = False> 
   1.151 -  class AddMap : public MapBase<typename M1::Key, typename M1::Value, NC> {
   1.152 -    typename SmartConstReference<M1>::Type m1;
   1.153 -    typename SmartConstReference<M2>::Type m2;
   1.154 +  template<typename M1, typename M2> 
   1.155 +  class AddMap : public MapBase<typename M1::Key, typename M1::Value> {
   1.156 +    const M1& m1;
   1.157 +    const M2& m2;
   1.158  
   1.159    public:
   1.160 -    typedef MapBase<typename M1::Key, typename M1::Value, NC> Parent;
   1.161 +    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
   1.162      typedef typename Parent::Key Key;
   1.163      typedef typename Parent::Value Value;
   1.164  
   1.165 @@ -313,8 +311,8 @@
   1.166    ///\relates AddMap
   1.167    ///\todo Wrong scope in Doxygen when \c \\relates is used
   1.168    template<typename M1, typename M2> 
   1.169 -  inline AddMap<M1, M2, True> addMap(const M1 &m1,const M2 &m2) {
   1.170 -    return AddMap<M1, M2, True>(m1,m2);
   1.171 +  inline AddMap<M1, M2> addMap(const M1 &m1,const M2 &m2) {
   1.172 +    return AddMap<M1, M2>(m1,m2);
   1.173    }
   1.174  
   1.175    ///Shift a map with a constant.
   1.176 @@ -332,12 +330,12 @@
   1.177    ///  ConstMap<X::Key, X::Value> c_tmp(v);
   1.178    ///  AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v);
   1.179    ///\endcode
   1.180 -  template<typename M, typename C = typename M::Value, typename NC = False> 
   1.181 -  class ShiftMap : public MapBase<typename M::Key, typename M::Value, NC> {
   1.182 -    typename SmartConstReference<M>::Type m;
   1.183 +  template<typename M, typename C = typename M::Value> 
   1.184 +  class ShiftMap : public MapBase<typename M::Key, typename M::Value> {
   1.185 +    const M& m;
   1.186      C v;
   1.187    public:
   1.188 -    typedef MapBase<typename M::Key, typename M::Value, NC> Parent;
   1.189 +    typedef MapBase<typename M::Key, typename M::Value> Parent;
   1.190      typedef typename Parent::Key Key;
   1.191      typedef typename Parent::Value Value;
   1.192  
   1.193 @@ -356,8 +354,8 @@
   1.194    ///\relates ShiftMap
   1.195    ///\todo A better name is required.
   1.196    template<typename M, typename C> 
   1.197 -  inline ShiftMap<M, C, True> shiftMap(const M &m,const C &v) {
   1.198 -    return ShiftMap<M, C, True>(m,v);
   1.199 +  inline ShiftMap<M, C> shiftMap(const M &m,const C &v) {
   1.200 +    return ShiftMap<M, C>(m,v);
   1.201    }
   1.202  
   1.203    ///Difference of two maps
   1.204 @@ -367,12 +365,12 @@
   1.205    ///given maps. Its \c Key and \c Value will be inherited from \c M1.
   1.206    ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
   1.207  
   1.208 -  template<typename M1, typename M2, typename NC = False> 
   1.209 -  class SubMap : public MapBase<typename M1::Key, typename M1::Value, NC> {
   1.210 -    typename SmartConstReference<M1>::Type m1;
   1.211 -    typename SmartConstReference<M2>::Type m2;
   1.212 +  template<typename M1, typename M2> 
   1.213 +  class SubMap : public MapBase<typename M1::Key, typename M1::Value> {
   1.214 +    const M1& m1;
   1.215 +    const M2& m2;
   1.216    public:
   1.217 -    typedef MapBase<typename M1::Key, typename M1::Value, NC> Parent;
   1.218 +    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
   1.219      typedef typename Parent::Key Key;
   1.220      typedef typename Parent::Value Value;
   1.221  
   1.222 @@ -387,8 +385,8 @@
   1.223    ///
   1.224    ///\relates SubMap
   1.225    template<typename M1, typename M2> 
   1.226 -  inline SubMap<M1, M2, True> subMap(const M1 &m1, const M2 &m2) {
   1.227 -    return SubMap<M1, M2, True>(m1, m2);
   1.228 +  inline SubMap<M1, M2> subMap(const M1 &m1, const M2 &m2) {
   1.229 +    return SubMap<M1, M2>(m1, m2);
   1.230    }
   1.231  
   1.232    ///Product of two maps
   1.233 @@ -399,12 +397,12 @@
   1.234    ///maps. Its \c Key and \c Value will be inherited from \c M1.
   1.235    ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
   1.236  
   1.237 -  template<typename M1, typename M2, typename NC = False> 
   1.238 -  class MulMap : public MapBase<typename M1::Key, typename M1::Value, NC> {
   1.239 -    typename SmartConstReference<M1>::Type m1;
   1.240 -    typename SmartConstReference<M2>::Type m2;
   1.241 +  template<typename M1, typename M2> 
   1.242 +  class MulMap : public MapBase<typename M1::Key, typename M1::Value> {
   1.243 +    const M1& m1;
   1.244 +    const M2& m2;
   1.245    public:
   1.246 -    typedef MapBase<typename M1::Key, typename M1::Value, NC> Parent;
   1.247 +    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
   1.248      typedef typename Parent::Key Key;
   1.249      typedef typename Parent::Value Value;
   1.250  
   1.251 @@ -418,8 +416,8 @@
   1.252    ///This function just returns a \ref MulMap class.
   1.253    ///\relates MulMap
   1.254    template<typename M1, typename M2> 
   1.255 -  inline MulMap<M1, M2, True> mulMap(const M1 &m1,const M2 &m2) {
   1.256 -    return MulMap<M1, M2, True>(m1,m2);
   1.257 +  inline MulMap<M1, M2> mulMap(const M1 &m1,const M2 &m2) {
   1.258 +    return MulMap<M1, M2>(m1,m2);
   1.259    }
   1.260   
   1.261    ///Scales a maps with a constant.
   1.262 @@ -437,12 +435,12 @@
   1.263    ///  ConstMap<X::Key, X::Value> c_tmp(v);
   1.264    ///  MulMap<X, ConstMap<X::Key, X::Value> > sc(x,v);
   1.265    ///\endcode
   1.266 -  template<typename M, typename C = typename M::Value, typename NC = False> 
   1.267 -  class ScaleMap : public MapBase<typename M::Key, typename M::Value, NC> {
   1.268 -    typename SmartConstReference<M>::Type m;
   1.269 +  template<typename M, typename C = typename M::Value> 
   1.270 +  class ScaleMap : public MapBase<typename M::Key, typename M::Value> {
   1.271 +    const M& m;
   1.272      C v;
   1.273    public:
   1.274 -    typedef MapBase<typename M::Key, typename M::Value, NC> Parent;
   1.275 +    typedef MapBase<typename M::Key, typename M::Value> Parent;
   1.276      typedef typename Parent::Key Key;
   1.277      typedef typename Parent::Value Value;
   1.278  
   1.279 @@ -461,8 +459,8 @@
   1.280    ///\relates ScaleMap
   1.281    ///\todo A better name is required.
   1.282    template<typename M, typename C> 
   1.283 -  inline ScaleMap<M, C, True> scaleMap(const M &m,const C &v) {
   1.284 -    return ScaleMap<M, C, True>(m,v);
   1.285 +  inline ScaleMap<M, C> scaleMap(const M &m,const C &v) {
   1.286 +    return ScaleMap<M, C>(m,v);
   1.287    }
   1.288  
   1.289    ///Quotient of two maps
   1.290 @@ -472,12 +470,12 @@
   1.291    ///given maps. Its \c Key and \c Value will be inherited from \c M1.
   1.292    ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
   1.293  
   1.294 -  template<typename M1, typename M2, typename NC = False> 
   1.295 -  class DivMap : public MapBase<typename M1::Key, typename M1::Value, NC> {
   1.296 -    typename SmartConstReference<M1>::Type m1;
   1.297 -    typename SmartConstReference<M2>::Type m2;
   1.298 +  template<typename M1, typename M2> 
   1.299 +  class DivMap : public MapBase<typename M1::Key, typename M1::Value> {
   1.300 +    const M1& m1;
   1.301 +    const M2& m2;
   1.302    public:
   1.303 -    typedef MapBase<typename M1::Key, typename M1::Value, NC> Parent;
   1.304 +    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
   1.305      typedef typename Parent::Key Key;
   1.306      typedef typename Parent::Value Value;
   1.307  
   1.308 @@ -491,8 +489,8 @@
   1.309    ///This function just returns a \ref DivMap class.
   1.310    ///\relates DivMap
   1.311    template<typename M1, typename M2> 
   1.312 -  inline DivMap<M1, M2, True> divMap(const M1 &m1,const M2 &m2) {
   1.313 -    return DivMap<M1, M2, True>(m1,m2);
   1.314 +  inline DivMap<M1, M2> divMap(const M1 &m1,const M2 &m2) {
   1.315 +    return DivMap<M1, M2>(m1,m2);
   1.316    }
   1.317    
   1.318    ///Composition of two maps
   1.319 @@ -512,12 +510,12 @@
   1.320    ///The \c M2::Value must be convertible to \c M1::Key.
   1.321    ///\todo Check the requirements.
   1.322  
   1.323 -  template <typename M1, typename M2, typename NC = False> 
   1.324 -  class ComposeMap : public MapBase<typename M2::Key, typename M1::Value, NC> {
   1.325 -    typename SmartConstReference<M1>::Type m1;
   1.326 -    typename SmartConstReference<M2>::Type m2;
   1.327 +  template <typename M1, typename M2> 
   1.328 +  class ComposeMap : public MapBase<typename M2::Key, typename M1::Value> {
   1.329 +    const M1& m1;
   1.330 +    const M2& m2;
   1.331    public:
   1.332 -    typedef MapBase<typename M2::Key, typename M1::Value, NC> Parent;
   1.333 +    typedef MapBase<typename M2::Key, typename M1::Value> Parent;
   1.334      typedef typename Parent::Key Key;
   1.335      typedef typename Parent::Value Value;
   1.336  
   1.337 @@ -531,8 +529,8 @@
   1.338    ///
   1.339    ///\relates ComposeMap
   1.340    template <typename M1, typename M2> 
   1.341 -  inline ComposeMap<M1, M2, True> composeMap(const M1 &m1,const M2 &m2) {
   1.342 -    return ComposeMap<M1, M2, True>(m1,m2);
   1.343 +  inline ComposeMap<M1, M2> composeMap(const M1 &m1,const M2 &m2) {
   1.344 +    return ComposeMap<M1, M2>(m1,m2);
   1.345    }
   1.346    
   1.347    ///Combines of two maps using an STL (binary) functor.
   1.348 @@ -561,12 +559,12 @@
   1.349    template<typename M1, typename M2, typename F,
   1.350  	   typename V = typename F::result_type,
   1.351  	   typename NC = False> 
   1.352 -  class CombineMap : public MapBase<typename M1::Key, V, NC> {
   1.353 -    typename SmartConstReference<M1>::Type m1;
   1.354 -    typename SmartConstReference<M2>::Type m2;
   1.355 +  class CombineMap : public MapBase<typename M1::Key, V> {
   1.356 +    const M1& m1;
   1.357 +    const M2& m2;
   1.358      F f;
   1.359    public:
   1.360 -    typedef MapBase<typename M1::Key, V, NC> Parent;
   1.361 +    typedef MapBase<typename M1::Key, V> Parent;
   1.362      typedef typename Parent::Key Key;
   1.363      typedef typename Parent::Value Value;
   1.364  
   1.365 @@ -593,19 +591,19 @@
   1.366    ///
   1.367    ///\relates CombineMap
   1.368    template<typename M1, typename M2, typename F, typename V> 
   1.369 -  inline CombineMap<M1, M2, F, V, True> 
   1.370 +  inline CombineMap<M1, M2, F, V> 
   1.371    combineMap(const M1& m1,const M2& m2, const F& f) {
   1.372 -    return CombineMap<M1, M2, F, V, True>(m1,m2,f);
   1.373 +    return CombineMap<M1, M2, F, V>(m1,m2,f);
   1.374    }
   1.375  
   1.376    template<typename M1, typename M2, typename F> 
   1.377 -  inline CombineMap<M1, M2, F, typename F::result_type, True> 
   1.378 +  inline CombineMap<M1, M2, F, typename F::result_type> 
   1.379    combineMap(const M1& m1, const M2& m2, const F& f) {
   1.380      return combineMap<M1, M2, F, typename F::result_type>(m1,m2,f);
   1.381    }
   1.382  
   1.383    template<typename M1, typename M2, typename K1, typename K2, typename V> 
   1.384 -  inline CombineMap<M1, M2, V (*)(K1, K2), V, True> 
   1.385 +  inline CombineMap<M1, M2, V (*)(K1, K2), V> 
   1.386    combineMap(const M1 &m1, const M2 &m2, V (*f)(K1, K2)) {
   1.387      return combineMap<M1, M2, V (*)(K1, K2), V>(m1,m2,f);
   1.388    }
   1.389 @@ -618,11 +616,11 @@
   1.390    ///given map. Its \c Key and \c Value will be inherited from \c M.
   1.391    ///The unary \c - operator must be defined for \c Value, of course.
   1.392  
   1.393 -  template<typename M, typename NC = False> 
   1.394 -  class NegMap : public MapBase<typename M::Key, typename M::Value, NC> {
   1.395 -    typename SmartConstReference<M>::Type m;
   1.396 +  template<typename M> 
   1.397 +  class NegMap : public MapBase<typename M::Key, typename M::Value> {
   1.398 +    const M& m;
   1.399    public:
   1.400 -    typedef MapBase<typename M::Key, typename M::Value, NC> Parent;
   1.401 +    typedef MapBase<typename M::Key, typename M::Value> Parent;
   1.402      typedef typename Parent::Key Key;
   1.403      typedef typename Parent::Value Value;
   1.404  
   1.405 @@ -636,8 +634,8 @@
   1.406    ///This function just returns a \ref NegMap class.
   1.407    ///\relates NegMap
   1.408    template <typename M> 
   1.409 -  inline NegMap<M, True> negMap(const M &m) {
   1.410 -    return NegMap<M, True>(m);
   1.411 +  inline NegMap<M> negMap(const M &m) {
   1.412 +    return NegMap<M>(m);
   1.413    }
   1.414  
   1.415  
   1.416 @@ -664,11 +662,11 @@
   1.417    ///\endcode
   1.418    
   1.419  
   1.420 -  template<typename M, typename NC = False> 
   1.421 -  class AbsMap : public MapBase<typename M::Key, typename M::Value, NC> {
   1.422 -    typename SmartConstReference<M>::Type m;
   1.423 +  template<typename M> 
   1.424 +  class AbsMap : public MapBase<typename M::Key, typename M::Value> {
   1.425 +    const M& m;
   1.426    public:
   1.427 -    typedef MapBase<typename M::Key, typename M::Value, NC> Parent;
   1.428 +    typedef MapBase<typename M::Key, typename M::Value> Parent;
   1.429      typedef typename Parent::Key Key;
   1.430      typedef typename Parent::Value Value;
   1.431  
   1.432 @@ -686,8 +684,8 @@
   1.433    ///This function just returns a \ref AbsMap class.
   1.434    ///\relates AbsMap
   1.435    template<typename M> 
   1.436 -  inline AbsMap<M, True> absMap(const M &m) {
   1.437 -    return AbsMap<M, True>(m);
   1.438 +  inline AbsMap<M> absMap(const M &m) {
   1.439 +    return AbsMap<M>(m);
   1.440    }
   1.441  
   1.442    ///Converts an STL style functor to a map
   1.443 @@ -707,10 +705,10 @@
   1.444  	   typename K = typename F::argument_type, 
   1.445  	   typename V = typename F::result_type,
   1.446  	   typename NC = False> 
   1.447 -  class FunctorMap : public MapBase<K, V, NC> {
   1.448 +  class FunctorMap : public MapBase<K, V> {
   1.449      F f;
   1.450    public:
   1.451 -    typedef MapBase<K, V, NC> Parent;
   1.452 +    typedef MapBase<K, V> Parent;
   1.453      typedef typename Parent::Key Key;
   1.454      typedef typename Parent::Value Value;
   1.455  
   1.456 @@ -727,20 +725,20 @@
   1.457    ///The third template parameter isn't necessary to be given.
   1.458    ///\relates FunctorMap
   1.459    template<typename K, typename V, typename F> inline 
   1.460 -  FunctorMap<F, K, V, True> functorMap(const F &f) {
   1.461 -    return FunctorMap<F, K, V, True>(f);
   1.462 +  FunctorMap<F, K, V> functorMap(const F &f) {
   1.463 +    return FunctorMap<F, K, V>(f);
   1.464    }
   1.465  
   1.466    template <typename F> inline 
   1.467 -  FunctorMap<F, typename F::argument_type, typename F::result_type, True> 
   1.468 +  FunctorMap<F, typename F::argument_type, typename F::result_type> 
   1.469    functorMap(const F &f) {
   1.470      return FunctorMap<F, typename F::argument_type, 
   1.471 -      typename F::result_type, True>(f);
   1.472 +      typename F::result_type>(f);
   1.473    }
   1.474  
   1.475    template <typename K, typename V> inline 
   1.476 -  FunctorMap<V (*)(K), K, V, True> functorMap(V (*f)(K)) {
   1.477 -    return FunctorMap<V (*)(K), K, V, True>(f);
   1.478 +  FunctorMap<V (*)(K), K, V> functorMap(V (*f)(K)) {
   1.479 +    return FunctorMap<V (*)(K), K, V>(f);
   1.480    }
   1.481  
   1.482  
   1.483 @@ -753,11 +751,11 @@
   1.484    ///a ususal \ref concept::ReadMap "readable map",
   1.485    ///i.e. <tt>operator[]</tt> and the \c Key and \c Value typedefs also exist.
   1.486  
   1.487 -  template <typename M, typename NC = False> 
   1.488 -  class MapFunctor : public MapBase<typename M::Key, typename M::Value, NC> {
   1.489 -    typename SmartConstReference<M>::Type m;
   1.490 +  template <typename M> 
   1.491 +  class MapFunctor : public MapBase<typename M::Key, typename M::Value> {
   1.492 +    const M& m;
   1.493    public:
   1.494 -    typedef MapBase<typename M::Key, typename M::Value, NC> Parent;
   1.495 +    typedef MapBase<typename M::Key, typename M::Value> Parent;
   1.496      typedef typename Parent::Key Key;
   1.497      typedef typename Parent::Value Value;
   1.498  
   1.499 @@ -779,8 +777,8 @@
   1.500    ///This function just returns a \ref MapFunctor class.
   1.501    ///\relates MapFunctor
   1.502    template<typename M> 
   1.503 -  inline MapFunctor<M, True> mapFunctor(const M &m) {
   1.504 -    return MapFunctor<M, True>(m);
   1.505 +  inline MapFunctor<M> mapFunctor(const M &m) {
   1.506 +    return MapFunctor<M>(m);
   1.507    }
   1.508  
   1.509  
   1.510 @@ -795,12 +793,12 @@
   1.511    ///The \c Key and \c Value will be inherited from \c M1.
   1.512    ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
   1.513  
   1.514 -  template<typename  M1, typename M2, typename NC = False> 
   1.515 -  class ForkMap : public MapBase<typename M1::Key, typename M1::Value, NC> {
   1.516 -    typename SmartConstReference<M1>::Type m1;
   1.517 -    typename SmartConstReference<M2>::Type m2;
   1.518 +  template<typename  M1, typename M2> 
   1.519 +  class ForkMap : public MapBase<typename M1::Key, typename M1::Value> {
   1.520 +    const M1& m1;
   1.521 +    const M2& m2;
   1.522    public:
   1.523 -    typedef MapBase<typename M1::Key, typename M1::Value, NC> Parent;
   1.524 +    typedef MapBase<typename M1::Key, typename M1::Value> Parent;
   1.525      typedef typename Parent::Key Key;
   1.526      typedef typename Parent::Value Value;
   1.527  
   1.528 @@ -818,8 +816,8 @@
   1.529    ///\relates ForkMap
   1.530    ///\todo Wrong scope in Doxygen when \c \\relates is used
   1.531    template <typename M1, typename M2> 
   1.532 -  inline ForkMap<M1, M2, True> forkMap(const M1 &m1,const M2 &m2) {
   1.533 -    return ForkMap<M1, M2, True>(m1,m2);
   1.534 +  inline ForkMap<M1, M2> forkMap(const M1 &m1,const M2 &m2) {
   1.535 +    return ForkMap<M1, M2>(m1,m2);
   1.536    }
   1.537  
   1.538  
   1.539 @@ -834,11 +832,11 @@
   1.540    ///given map. Its \c Key and will be inherited from \c M,
   1.541    ///its Value is <tt>bool</tt>.
   1.542  
   1.543 -  template <typename M, typename NC = False> 
   1.544 -  class NotMap : public MapBase<typename M::Key, bool, NC> {
   1.545 -    typename SmartConstReference<M>::Type m;
   1.546 +  template <typename M> 
   1.547 +  class NotMap : public MapBase<typename M::Key, bool> {
   1.548 +    const M& m;
   1.549    public:
   1.550 -    typedef MapBase<typename M::Key, bool, NC> Parent;
   1.551 +    typedef MapBase<typename M::Key, bool> Parent;
   1.552      typedef typename Parent::Key Key;
   1.553      typedef typename Parent::Value Value;
   1.554  
   1.555 @@ -852,8 +850,8 @@
   1.556    ///This function just returns a \ref NotMap class.
   1.557    ///\relates NotMap
   1.558    template <typename M> 
   1.559 -  inline NotMap<M, True> notMap(const M &m) {
   1.560 -    return NotMap<M, True>(m);
   1.561 +  inline NotMap<M> notMap(const M &m) {
   1.562 +    return NotMap<M>(m);
   1.563    }
   1.564  
   1.565    /// @}