# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1221510512 -7200
# Node ID be8a861d3bb7cac5c1ee56cbd8a9ceecef514292
# Parent  c691064dfd4f2e3d4e230a1fd9845a1d96de2a5d
Make copy constr and op= of the default maps private (ticket #137)

diff -r c691064dfd4f -r be8a861d3bb7 lemon/bits/array_map.h
--- a/lemon/bits/array_map.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/lemon/bits/array_map.h	Mon Sep 15 22:28:32 2008 +0200
@@ -103,6 +103,7 @@
       }
     }
 
+  private:
     /// \brief Constructor to copy a map of the same map type.
     ///
     /// Constructor to copy a map of the same map type.
@@ -150,6 +151,7 @@
       return *this;
     }
 
+  public:
     /// \brief The destructor of the map.
     ///
     /// The destructor of the map.
diff -r c691064dfd4f -r be8a861d3bb7 lemon/bits/graph_extender.h
--- a/lemon/bits/graph_extender.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/lemon/bits/graph_extender.h	Mon Sep 15 22:28:32 2008 +0200
@@ -227,6 +227,7 @@
       NodeMap(const Digraph& digraph, const _Value& value)
         : Parent(digraph, value) {}
 
+    private:
       NodeMap& operator=(const NodeMap& cmap) {
         return operator=<NodeMap>(cmap);
       }
@@ -251,6 +252,7 @@
       ArcMap(const Digraph& digraph, const _Value& value)
         : Parent(digraph, value) {}
 
+    private:
       ArcMap& operator=(const ArcMap& cmap) {
         return operator=<ArcMap>(cmap);
       }
@@ -608,6 +610,7 @@
       NodeMap(const Graph& graph, const _Value& value)
         : Parent(graph, value) {}
 
+    private:
       NodeMap& operator=(const NodeMap& cmap) {
         return operator=<NodeMap>(cmap);
       }
@@ -632,6 +635,7 @@
       ArcMap(const Graph& graph, const _Value& value)
         : Parent(graph, value) {}
 
+    private:
       ArcMap& operator=(const ArcMap& cmap) {
         return operator=<ArcMap>(cmap);
       }
@@ -657,6 +661,7 @@
       EdgeMap(const Graph& graph, const _Value& value)
         : Parent(graph, value) {}
 
+    private:
       EdgeMap& operator=(const EdgeMap& cmap) {
         return operator=<EdgeMap>(cmap);
       }
diff -r c691064dfd4f -r be8a861d3bb7 lemon/bits/map_extender.h
--- a/lemon/bits/map_extender.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/lemon/bits/map_extender.h	Mon Sep 15 22:28:32 2008 +0200
@@ -62,6 +62,7 @@
     MapExtender(const Graph& graph, const Value& value)
       : Parent(graph, value) {}
 
+  private:
     MapExtender& operator=(const MapExtender& cmap) {
       return operator=<MapExtender>(cmap);
     }
@@ -72,6 +73,7 @@
       return *this;
     }
 
+  public:
     class MapIt : public Item {
     public:
 
@@ -200,6 +202,7 @@
     SubMapExtender(const Graph& _graph, const Value& _value)
       : Parent(_graph, _value), graph(_graph) {}
 
+  private:
     SubMapExtender& operator=(const SubMapExtender& cmap) {
       return operator=<MapExtender>(cmap);
     }
@@ -214,6 +217,7 @@
       return *this;
     }
 
+  public:
     class MapIt : public Item {
     public:
 
diff -r c691064dfd4f -r be8a861d3bb7 lemon/bits/vector_map.h
--- a/lemon/bits/vector_map.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/lemon/bits/vector_map.h	Mon Sep 15 22:28:32 2008 +0200
@@ -100,6 +100,7 @@
       container.resize(Parent::notifier()->maxId() + 1, value);
     }
 
+  private:
     /// \brief Copy constructor
     ///
     /// Copy constructor.
diff -r c691064dfd4f -r be8a861d3bb7 lemon/concepts/digraph.h
--- a/lemon/concepts/digraph.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/lemon/concepts/digraph.h	Mon Sep 15 22:28:32 2008 +0200
@@ -434,6 +434,7 @@
         ///\e
         NodeMap(const Digraph&, T) { }
 
+      private:
         ///Copy constructor
         NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
         ///Assignment operator
@@ -456,6 +457,7 @@
         ArcMap(const Digraph&) { }
         ///\e
         ArcMap(const Digraph&, T) { }
+      private:
         ///Copy constructor
         ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
         ///Assignment operator
diff -r c691064dfd4f -r be8a861d3bb7 lemon/concepts/graph.h
--- a/lemon/concepts/graph.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/lemon/concepts/graph.h	Mon Sep 15 22:28:32 2008 +0200
@@ -512,6 +512,7 @@
         ///\e
         NodeMap(const Graph&, T) { }
 
+      private:
         ///Copy constructor
         NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
         ///Assignment operator
@@ -535,6 +536,7 @@
         ArcMap(const Graph&) { }
         ///\e
         ArcMap(const Graph&, T) { }
+      private:
         ///Copy constructor
         ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
         ///Assignment operator
@@ -558,6 +560,7 @@
         EdgeMap(const Graph&) { }
         ///\e
         EdgeMap(const Graph&, T) { }
+      private:
         ///Copy constructor
         EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {}
         ///Assignment operator
diff -r c691064dfd4f -r be8a861d3bb7 lemon/concepts/graph_components.h
--- a/lemon/concepts/graph_components.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/lemon/concepts/graph_components.h	Mon Sep 15 22:28:32 2008 +0200
@@ -1005,6 +1005,8 @@
       ///
       /// Construct a new map for the graph and initalise the values.
       GraphMap(const Graph&, const Value&) {}
+
+    private:
       /// \brief Copy constructor.
       ///
       /// Copy Constructor.
@@ -1021,6 +1023,7 @@
         return *this;
       }
 
+    public:
       template<typename _Map>
       struct Constraints {
         void constraints() {
@@ -1030,13 +1033,14 @@
           // Constructor with a graph and a default value parameter
           _Map a2(g,t);
           // Copy constructor.
-          _Map b(c);
+          // _Map b(c);
 
-          ReadMap<Key, Value> cmap;
-          b = cmap;
+          // ReadMap<Key, Value> cmap;
+          // b = cmap;
 
+          ignore_unused_variable_warning(a);
           ignore_unused_variable_warning(a2);
-          ignore_unused_variable_warning(b);
+          // ignore_unused_variable_warning(b);
         }
 
         const _Map &c;
@@ -1082,6 +1086,7 @@
         NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
           : Parent(digraph, value) {}
 
+      private:
         /// \brief Copy constructor.
         ///
         /// Copy Constructor.
@@ -1119,6 +1124,7 @@
         ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
           : Parent(digraph, value) {}
 
+      private:
         /// \brief Copy constructor.
         ///
         /// Copy Constructor.
@@ -1215,6 +1221,7 @@
         EdgeMap(const MappableGraphComponent& graph, const _Value& value)
           : Parent(graph, value) {}
 
+      private:
         /// \brief Copy constructor.
         ///
         /// Copy Constructor.
diff -r c691064dfd4f -r be8a861d3bb7 test/graph_test.h
--- a/test/graph_test.h	Thu Sep 11 11:10:44 2008 +0100
+++ b/test/graph_test.h	Mon Sep 15 22:28:32 2008 +0200
@@ -212,10 +212,10 @@
     }
     check(s == 0, "Wrong sum.");
 
-    map = constMap<Node>(12);
-    for (NodeIt it(G); it != INVALID; ++it) {
-      check(map[it] == 12, "Wrong operator[].");
-    }
+    // map = constMap<Node>(12);
+    // for (NodeIt it(G); it != INVALID; ++it) {
+    //   check(map[it] == 12, "Wrong operator[].");
+    // }
   }
 
   template <typename Graph>
@@ -242,10 +242,10 @@
     }
     check(s == 0, "Wrong sum.");
 
-    map = constMap<Arc>(12);
-    for (ArcIt it(G); it != INVALID; ++it) {
-      check(map[it] == 12, "Wrong operator[].");
-    }
+    // map = constMap<Arc>(12);
+    // for (ArcIt it(G); it != INVALID; ++it) {
+    //   check(map[it] == 12, "Wrong operator[].");
+    // }
   }
 
   template <typename Graph>
@@ -272,10 +272,10 @@
     }
     check(s == 0, "Wrong sum.");
 
-    map = constMap<Edge>(12);
-    for (EdgeIt it(G); it != INVALID; ++it) {
-      check(map[it] == 12, "Wrong operator[].");
-    }
+    // map = constMap<Edge>(12);
+    // for (EdgeIt it(G); it != INVALID; ++it) {
+    //   check(map[it] == 12, "Wrong operator[].");
+    // }
   }