1.1 --- a/lemon/concept/ugraph.h Wed Jul 05 16:59:45 2006 +0000
1.2 +++ b/lemon/concept/ugraph.h Mon Jul 10 19:04:17 2006 +0000
1.3 @@ -489,7 +489,6 @@
1.4 /// \sa Reference
1.5 /// \warning Making maps that can handle bool type (NodeMap<bool>)
1.6 /// needs some extra attention!
1.7 - /// \todo Wrong documentation
1.8 template<class T>
1.9 class NodeMap : public ReadWriteMap< Node, T >
1.10 {
1.11 @@ -503,8 +502,11 @@
1.12 ///Copy constructor
1.13 NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
1.14 ///Assignment operator
1.15 - NodeMap& operator=(const NodeMap&) { return *this; }
1.16 - // \todo fix this concept
1.17 + template <typename CMap>
1.18 + NodeMap& operator=(const CMap&) {
1.19 + checkConcept<ReadMap<Node, T>, CMap>();
1.20 + return *this;
1.21 + }
1.22 };
1.23
1.24 /// \brief Read write map of the directed edges to type \c T.
1.25 @@ -513,7 +515,6 @@
1.26 /// \sa Reference
1.27 /// \warning Making maps that can handle bool type (EdgeMap<bool>)
1.28 /// needs some extra attention!
1.29 - /// \todo Wrong documentation
1.30 template<class T>
1.31 class EdgeMap : public ReadWriteMap<Edge,T>
1.32 {
1.33 @@ -526,8 +527,11 @@
1.34 ///Copy constructor
1.35 EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { }
1.36 ///Assignment operator
1.37 - EdgeMap& operator=(const EdgeMap&) { return *this; }
1.38 - // \todo fix this concept
1.39 + template <typename CMap>
1.40 + EdgeMap& operator=(const CMap&) {
1.41 + checkConcept<ReadMap<Edge, T>, CMap>();
1.42 + return *this;
1.43 + }
1.44 };
1.45
1.46 /// Read write map of the undirected edges to type \c T.
1.47 @@ -536,7 +540,6 @@
1.48 /// \sa Reference
1.49 /// \warning Making maps that can handle bool type (UEdgeMap<bool>)
1.50 /// needs some extra attention!
1.51 - /// \todo Wrong documentation
1.52 template<class T>
1.53 class UEdgeMap : public ReadWriteMap<UEdge,T>
1.54 {
1.55 @@ -549,8 +552,11 @@
1.56 ///Copy constructor
1.57 UEdgeMap(const UEdgeMap& em) : ReadWriteMap<UEdge,T>(em) {}
1.58 ///Assignment operator
1.59 - UEdgeMap &operator=(const UEdgeMap&) { return *this; }
1.60 - // \todo fix this concept
1.61 + template <typename CMap>
1.62 + UEdgeMap& operator=(const CMap&) {
1.63 + checkConcept<ReadMap<UEdge, T>, CMap>();
1.64 + return *this;
1.65 + }
1.66 };
1.67
1.68 /// \brief Direct the given undirected edge.
1.69 @@ -672,9 +678,9 @@
1.70 template <typename Graph>
1.71 struct Constraints {
1.72 void constraints() {
1.73 - checkConcept<BaseIterableUGraphConcept, Graph>();
1.74 - checkConcept<IterableUGraphConcept, Graph>();
1.75 - checkConcept<MappableUGraphConcept, Graph>();
1.76 + checkConcept<BaseIterableUGraphComponent<>, Graph>();
1.77 + checkConcept<IterableUGraphComponent<>, Graph>();
1.78 + checkConcept<MappableUGraphComponent<>, Graph>();
1.79 }
1.80 };
1.81