diff -r d769d2eb4d50 -r 080d51024ac5 lemon/bits/array_map.h --- a/lemon/bits/array_map.h Mon Apr 03 09:24:38 2006 +0000 +++ b/lemon/bits/array_map.h Mon Apr 03 09:45:23 2006 +0000 @@ -23,6 +23,8 @@ #include #include +#include +#include /// \ingroup graphbits /// \file @@ -119,6 +121,35 @@ } } + /// \brief Assign operator. + /// + /// This operator assigns for each item in the map the + /// value mapped to the same item in the copied map. + /// The parameter map should be indiced with the same + /// itemset because this assign operator does not change + /// the container of the map. + ArrayMap& operator=(const ArrayMap& cmap) { + return operator=(cmap); + } + + + /// \brief Template assign operator. + /// + /// The given parameter should be conform to the ReadMap + /// concecpt and could be indiced by the current item set of + /// the NodeMap. In this case the value for each item + /// is assigned by the value of the given ReadMap. + template + ArrayMap& operator=(const CMap& cmap) { + checkConcept, CMap>(); + const typename Parent::Notifier* notifier = Parent::getNotifier(); + Item it; + for (notifier->first(it); it != INVALID; notifier->next(it)) { + set(it, cmap[it]); + } + return *this; + } + /// \brief The destructor of the map. /// /// The destructor of the map. @@ -129,10 +160,6 @@ } } - private: - - ArrayMap& operator=(const ArrayMap&); - protected: using Parent::attach;