Make constructor explicit
authordeba
Wed, 02 Nov 2005 15:28:37 +0000
changeset 1755bf267b301a5e
parent 1754 4bf5ceb49023
child 1756 b1f441f24d08
Make constructor explicit
Indentation changed
lemon/bfs.h
lemon/graph_adaptor.h
     1.1 --- a/lemon/bfs.h	Wed Nov 02 15:27:38 2005 +0000
     1.2 +++ b/lemon/bfs.h	Wed Nov 02 15:28:37 2005 +0000
     1.3 @@ -550,10 +550,10 @@
     1.4      ///\param nm must be a bool (or convertible) node map. The algorithm
     1.5      ///will stop when it reaches a node \c v with <tt>nm[v]==true</tt>.
     1.6      template<class NM>
     1.7 -      void start(const NM &nm)
     1.8 -      {
     1.9 -	while ( !emptyQueue() && !nm[_queue[_queue_tail]] ) processNextNode();
    1.10 -      }
    1.11 +    void start(const NM &nm)
    1.12 +    {
    1.13 +      while ( !emptyQueue() && !nm[_queue[_queue_tail]] ) processNextNode();
    1.14 +    }
    1.15      
    1.16      ///Runs %BFS algorithm from node \c s.
    1.17      
     2.1 --- a/lemon/graph_adaptor.h	Wed Nov 02 15:27:38 2005 +0000
     2.2 +++ b/lemon/graph_adaptor.h	Wed Nov 02 15:28:37 2005 +0000
     2.3 @@ -127,18 +127,20 @@
     2.4      class NodeMap : public _Graph::template NodeMap<_Value> {
     2.5      public:
     2.6        typedef typename _Graph::template NodeMap<_Value> Parent;
     2.7 -      NodeMap(const GraphAdaptorBase<_Graph>& gw) : Parent(*gw.graph) { }
     2.8 +      explicit NodeMap(const GraphAdaptorBase<_Graph>& gw) 
     2.9 +	: Parent(*gw.graph) { }
    2.10        NodeMap(const GraphAdaptorBase<_Graph>& gw, const _Value& value)
    2.11 -      : Parent(*gw.graph, value) { }
    2.12 +	: Parent(*gw.graph, value) { }
    2.13      };
    2.14  
    2.15      template <typename _Value>
    2.16      class EdgeMap : public _Graph::template EdgeMap<_Value> {
    2.17      public:
    2.18        typedef typename _Graph::template EdgeMap<_Value> Parent;
    2.19 -      EdgeMap(const GraphAdaptorBase<_Graph>& gw) : Parent(*gw.graph) { }
    2.20 +      explicit EdgeMap(const GraphAdaptorBase<_Graph>& gw) 
    2.21 +	: Parent(*gw.graph) { }
    2.22        EdgeMap(const GraphAdaptorBase<_Graph>& gw, const _Value& value)
    2.23 -      : Parent(*gw.graph, value) { }
    2.24 +	: Parent(*gw.graph, value) { }
    2.25      };
    2.26  
    2.27    };
    2.28 @@ -153,7 +155,7 @@
    2.29      GraphAdaptor() : Parent() { }
    2.30  
    2.31    public:
    2.32 -    GraphAdaptor(Graph& _graph) { setGraph(_graph); }
    2.33 +    explicit GraphAdaptor(Graph& _graph) { setGraph(_graph); }
    2.34    };
    2.35  
    2.36    template <typename _Graph>
    2.37 @@ -211,7 +213,7 @@
    2.38    protected:
    2.39      RevGraphAdaptor() { }
    2.40    public:
    2.41 -    RevGraphAdaptor(_Graph& _graph) { setGraph(_graph); }
    2.42 +    explicit RevGraphAdaptor(_Graph& _graph) { setGraph(_graph); }
    2.43    };
    2.44  
    2.45