Changeset 2031:080d51024ac5 in lemon-0.x for lemon/bits/array_map.h
- Timestamp:
- 04/03/06 11:45:23 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2670
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/array_map.h
r1999 r2031 24 24 #include <lemon/bits/traits.h> 25 25 #include <lemon/bits/alteration_notifier.h> 26 #include <lemon/concept_check.h> 27 #include <lemon/concept/maps.h> 26 28 27 29 /// \ingroup graphbits … … 120 122 } 121 123 124 /// \brief Assign operator. 125 /// 126 /// This operator assigns for each item in the map the 127 /// value mapped to the same item in the copied map. 128 /// The parameter map should be indiced with the same 129 /// itemset because this assign operator does not change 130 /// the container of the map. 131 ArrayMap& operator=(const ArrayMap& cmap) { 132 return operator=<ArrayMap>(cmap); 133 } 134 135 136 /// \brief Template assign operator. 137 /// 138 /// The given parameter should be conform to the ReadMap 139 /// concecpt and could be indiced by the current item set of 140 /// the NodeMap. In this case the value for each item 141 /// is assigned by the value of the given ReadMap. 142 template <typename CMap> 143 ArrayMap& operator=(const CMap& cmap) { 144 checkConcept<concept::ReadMap<Key, _Value>, CMap>(); 145 const typename Parent::Notifier* notifier = Parent::getNotifier(); 146 Item it; 147 for (notifier->first(it); it != INVALID; notifier->next(it)) { 148 set(it, cmap[it]); 149 } 150 return *this; 151 } 152 122 153 /// \brief The destructor of the map. 123 154 /// … … 130 161 } 131 162 132 private:133 134 ArrayMap& operator=(const ArrayMap&);135 136 163 protected: 137 164
Note: See TracChangeset
for help on using the changeset viewer.