Changes in the Maps' copy constructors.
authoralpar
Sun, 09 May 2004 16:21:56 +0000
changeset 5905c1465127b79
parent 589 d89575370bcb
child 591 eb532eef6170
Changes in the Maps' copy constructors.
src/hugo/list_graph.h
src/hugo/smart_graph.h
     1.1 --- a/src/hugo/list_graph.h	Sun May 09 16:20:41 2004 +0000
     1.2 +++ b/src/hugo/list_graph.h	Sun May 09 16:21:56 2004 +0000
     1.3 @@ -419,7 +419,8 @@
     1.4        ///\todo It can copy between different types.
     1.5        ///
     1.6        template<typename TT> NodeMap(const NodeMap<TT> &m) :
     1.7 -	DynMapBase<Node>(*m.G)
     1.8 +	DynMapBase<Node>(*m.G), container(m.container.size())
     1.9 +
    1.10        {
    1.11  	G->dyn_node_maps.push_back(this);
    1.12  	typename std::vector<TT>::const_iterator i;
    1.13 @@ -511,7 +512,7 @@
    1.14        ///\todo It can copy between different types.
    1.15        ///
    1.16        template<typename TT> EdgeMap(const EdgeMap<TT> &m) :
    1.17 -	DynMapBase<Edge>(*m.G)
    1.18 +	DynMapBase<Edge>(*m.G), container(m.container.size())
    1.19        {
    1.20  	G->dyn_edge_maps.push_back(this);
    1.21  	typename std::vector<TT>::const_iterator i;
    1.22 @@ -662,7 +663,7 @@
    1.23        ///
    1.24  
    1.25        template<typename TT> SymEdgeMap(const SymEdgeMap<TT> &m) :
    1.26 -	DynMapBase<SymEdge>(*m.G)
    1.27 +	DynMapBase<SymEdge>(*m.G), container(m.container.size())
    1.28        {
    1.29  	G->dyn_node_maps.push_back(this);
    1.30  	typename std::vector<TT>::const_iterator i;
    1.31 @@ -1033,7 +1034,7 @@
    1.32        ///\todo It can copy between different types.
    1.33        ///
    1.34        template<typename TT> NodeMap(const NodeMap<TT> &m) :
    1.35 -	DynMapBase<Node>(*m.G)
    1.36 +	DynMapBase<Node>(*m.G), container(m.container.size())
    1.37        {
    1.38  	G->dyn_node_maps.push_back(this);
    1.39  	typename std::vector<TT>::const_iterator i;
    1.40 @@ -1555,7 +1556,7 @@
    1.41        ///\todo It can copy between different types.
    1.42        ///
    1.43        template<typename TT> EdgeMap(const EdgeMap<TT> &m) :
    1.44 -	DynMapBase<Edge>(*m.G)
    1.45 +	DynMapBase<Edge>(*m.G), container(m.container.size())
    1.46        {
    1.47  	G->dyn_edge_maps.push_back(this);
    1.48  	typename std::vector<TT>::const_iterator i;
     2.1 --- a/src/hugo/smart_graph.h	Sun May 09 16:20:41 2004 +0000
     2.2 +++ b/src/hugo/smart_graph.h	Sun May 09 16:21:56 2004 +0000
     2.3 @@ -63,7 +63,7 @@
     2.4      
     2.5    public:
     2.6      template <typename T> class EdgeMap;
     2.7 -    template <typename T> class EdgeMap;
     2.8 +    template <typename T> class NodeMap;
     2.9  
    2.10      class Node;
    2.11      class Edge;
    2.12 @@ -307,9 +307,9 @@
    2.13        template<typename TT> friend class NodeMap;
    2.14   
    2.15        ///\todo It can copy between different types.
    2.16 -      ///
    2.17 +      ///\todo We could use 'copy'
    2.18        template<typename TT> NodeMap(const NodeMap<TT> &m) :
    2.19 -	DynMapBase<Node>(*m.G)
    2.20 +	DynMapBase<Node>(*m.G), container(m.container.size())
    2.21        {
    2.22  	G->dyn_node_maps.push_back(this);
    2.23  	typename std::vector<TT>::const_iterator i;
    2.24 @@ -398,9 +398,8 @@
    2.25        template<typename TT> friend class EdgeMap;
    2.26  
    2.27        ///\todo It can copy between different types.
    2.28 -      ///
    2.29 -      template<typename TT> EdgeMap(const EdgeMap<TT> &m) :
    2.30 -	DynMapBase<Edge>(*m.G)
    2.31 +      template<typename TT> EdgeMap(const EdgeMap<TT> &m)
    2.32 +	: DynMapBase<Edge>(*m.G), container(m.container.size())
    2.33        {
    2.34  	G->dyn_edge_maps.push_back(this);
    2.35  	typename std::vector<TT>::const_iterator i;
    2.36 @@ -541,8 +540,8 @@
    2.37        ///\todo It can copy between different types.
    2.38        ///
    2.39  
    2.40 -      template<typename TT> SymEdgeMap(const SymEdgeMap<TT> &m) :
    2.41 -	DynMapBase<SymEdge>(*m.G)
    2.42 +      template<typename TT> SymEdgeMap(const SymEdgeMap<TT> &m)
    2.43 +	: DynMapBase<SymEdge>(*m.G), container(m.container.size())
    2.44        {
    2.45  	G->dyn_node_maps.push_back(this);
    2.46  	typename std::vector<TT>::const_iterator i;
    2.47 @@ -613,4 +612,4 @@
    2.48  
    2.49  
    2.50  
    2.51 -#endif //SMART_GRAPH_H
    2.52 +#endif //HUGO_SMART_GRAPH_H