lemon/concepts/maps.h
changeset 209 765619b7cbb2
parent 114 c837d1e449dc
child 210 81cfc04531e8
     1.1 --- a/lemon/concepts/maps.h	Sun Jul 13 16:46:56 2008 +0100
     1.2 +++ b/lemon/concepts/maps.h	Sun Jul 13 19:51:02 2008 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4 -/* -*- C++ -*-
     1.5 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
     1.6   *
     1.7 - * This file is a part of LEMON, a generic C++ optimization library
     1.8 + * This file is a part of LEMON, a generic C++ optimization library.
     1.9   *
    1.10   * Copyright (C) 2003-2008
    1.11   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.12 @@ -47,26 +47,26 @@
    1.13        typedef T Value;
    1.14  
    1.15        /// Returns the value associated with the given key.
    1.16 -      Value operator[](const Key &) const { 
    1.17 +      Value operator[](const Key &) const {
    1.18          return *static_cast<Value *>(0);
    1.19        }
    1.20  
    1.21        template<typename _ReadMap>
    1.22        struct Constraints {
    1.23 -	void constraints() {
    1.24 -	  Value val = m[key];
    1.25 -	  val = m[key];
    1.26 -	  typename _ReadMap::Value own_val = m[own_key];
    1.27 -	  own_val = m[own_key];
    1.28 +        void constraints() {
    1.29 +          Value val = m[key];
    1.30 +          val = m[key];
    1.31 +          typename _ReadMap::Value own_val = m[own_key];
    1.32 +          own_val = m[own_key];
    1.33  
    1.34 -	  ignore_unused_variable_warning(key);
    1.35 -	  ignore_unused_variable_warning(val);
    1.36 -	  ignore_unused_variable_warning(own_key);
    1.37 -	  ignore_unused_variable_warning(own_val);
    1.38 -	}
    1.39 -	const Key& key;
    1.40 -	const typename _ReadMap::Key& own_key;
    1.41 -	const _ReadMap& m;
    1.42 +          ignore_unused_variable_warning(key);
    1.43 +          ignore_unused_variable_warning(val);
    1.44 +          ignore_unused_variable_warning(own_key);
    1.45 +          ignore_unused_variable_warning(own_val);
    1.46 +        }
    1.47 +        const Key& key;
    1.48 +        const typename _ReadMap::Key& own_key;
    1.49 +        const _ReadMap& m;
    1.50        };
    1.51  
    1.52      };
    1.53 @@ -93,20 +93,20 @@
    1.54  
    1.55        template <typename _WriteMap>
    1.56        struct Constraints {
    1.57 -	void constraints() {
    1.58 -	  m.set(key, val);
    1.59 -	  m.set(own_key, own_val);
    1.60 +        void constraints() {
    1.61 +          m.set(key, val);
    1.62 +          m.set(own_key, own_val);
    1.63  
    1.64 -	  ignore_unused_variable_warning(key);
    1.65 -	  ignore_unused_variable_warning(val);
    1.66 -	  ignore_unused_variable_warning(own_key);
    1.67 -	  ignore_unused_variable_warning(own_val);
    1.68 -	}
    1.69 -	const Key& key;
    1.70 -	const Value& val;
    1.71 -	const typename _WriteMap::Key& own_key;
    1.72 -	const typename _WriteMap::Value& own_val;
    1.73 -	_WriteMap& m;
    1.74 +          ignore_unused_variable_warning(key);
    1.75 +          ignore_unused_variable_warning(val);
    1.76 +          ignore_unused_variable_warning(own_key);
    1.77 +          ignore_unused_variable_warning(own_val);
    1.78 +        }
    1.79 +        const Key& key;
    1.80 +        const Value& val;
    1.81 +        const typename _WriteMap::Key& own_key;
    1.82 +        const typename _WriteMap::Value& own_val;
    1.83 +        _WriteMap& m;
    1.84        };
    1.85      };
    1.86  
    1.87 @@ -116,7 +116,7 @@
    1.88      ///
    1.89      template<typename K, typename T>
    1.90      class ReadWriteMap : public ReadMap<K,T>,
    1.91 -			 public WriteMap<K,T>
    1.92 +                         public WriteMap<K,T>
    1.93      {
    1.94      public:
    1.95        /// The key type of the map.
    1.96 @@ -125,7 +125,7 @@
    1.97        typedef T Value;
    1.98  
    1.99        /// Returns the value associated with the given key.
   1.100 -      Value operator[](const Key &) const { 
   1.101 +      Value operator[](const Key &) const {
   1.102          return *static_cast<Value *>(0);
   1.103        }
   1.104  
   1.105 @@ -134,10 +134,10 @@
   1.106  
   1.107        template<typename _ReadWriteMap>
   1.108        struct Constraints {
   1.109 -	void constraints() {
   1.110 -	  checkConcept<ReadMap<K, T>, _ReadWriteMap >();
   1.111 -	  checkConcept<WriteMap<K, T>, _ReadWriteMap >();
   1.112 -	}
   1.113 +        void constraints() {
   1.114 +          checkConcept<ReadMap<K, T>, _ReadWriteMap >();
   1.115 +          checkConcept<WriteMap<K, T>, _ReadWriteMap >();
   1.116 +        }
   1.117        };
   1.118      };
   1.119  
   1.120 @@ -164,7 +164,7 @@
   1.121      public:
   1.122  
   1.123        /// Returns a reference to the value associated with the given key.
   1.124 -      Reference operator[](const Key &) { 
   1.125 +      Reference operator[](const Key &) {
   1.126          return *static_cast<Value *>(0);
   1.127        }
   1.128  
   1.129 @@ -178,28 +178,28 @@
   1.130  
   1.131        template<typename _ReferenceMap>
   1.132        struct Constraints {
   1.133 -	void constraints() {
   1.134 -	  checkConcept<ReadWriteMap<K, T>, _ReferenceMap >();
   1.135 -	  ref = m[key];
   1.136 -	  m[key] = val;
   1.137 -	  m[key] = ref;
   1.138 -	  m[key] = cref;
   1.139 -	  own_ref = m[own_key];
   1.140 -	  m[own_key] = own_val;
   1.141 -	  m[own_key] = own_ref;
   1.142 -	  m[own_key] = own_cref;
   1.143 -	  m[key] = m[own_key];
   1.144 -	  m[own_key] = m[key];
   1.145 -	}
   1.146 -	const Key& key;
   1.147 -	Value& val;
   1.148 -	Reference ref;
   1.149 -	ConstReference cref;
   1.150 -	const typename _ReferenceMap::Key& own_key;
   1.151 -	typename _ReferenceMap::Value& own_val;
   1.152 -	typename _ReferenceMap::Reference own_ref;
   1.153 -	typename _ReferenceMap::ConstReference own_cref;
   1.154 -	_ReferenceMap& m;
   1.155 +        void constraints() {
   1.156 +          checkConcept<ReadWriteMap<K, T>, _ReferenceMap >();
   1.157 +          ref = m[key];
   1.158 +          m[key] = val;
   1.159 +          m[key] = ref;
   1.160 +          m[key] = cref;
   1.161 +          own_ref = m[own_key];
   1.162 +          m[own_key] = own_val;
   1.163 +          m[own_key] = own_ref;
   1.164 +          m[own_key] = own_cref;
   1.165 +          m[key] = m[own_key];
   1.166 +          m[own_key] = m[key];
   1.167 +        }
   1.168 +        const Key& key;
   1.169 +        Value& val;
   1.170 +        Reference ref;
   1.171 +        ConstReference cref;
   1.172 +        const typename _ReferenceMap::Key& own_key;
   1.173 +        typename _ReferenceMap::Value& own_val;
   1.174 +        typename _ReferenceMap::Reference own_ref;
   1.175 +        typename _ReferenceMap::ConstReference own_cref;
   1.176 +        _ReferenceMap& m;
   1.177        };
   1.178      };
   1.179