Forbid copy construction of StaticDigraph
authorGabriel Gouvine <gabriel.gouvine.GIT@gmx.com>
Fri, 27 Jan 2017 20:35:13 +0100
changeset 11570898f3371d1d
parent 1156 f51c01a1b88e
child 1160 bc571f16e1e9
Forbid copy construction of StaticDigraph
lemon/static_graph.h
     1.1 --- a/lemon/static_graph.h	Mon Nov 16 08:46:42 2015 +0100
     1.2 +++ b/lemon/static_graph.h	Fri Jan 27 20:35:13 2017 +0100
     1.3 @@ -29,6 +29,7 @@
     1.4  namespace lemon {
     1.5  
     1.6    class StaticDigraphBase {
     1.7 +
     1.8    public:
     1.9  
    1.10      StaticDigraphBase()
    1.11 @@ -296,6 +297,14 @@
    1.12    ///
    1.13    /// \sa concepts::Digraph
    1.14    class StaticDigraph : public ExtendedStaticDigraphBase {
    1.15 +
    1.16 +  private:
    1.17 +    /// Graphs are \e not copy constructible. Use DigraphCopy instead.
    1.18 +    StaticDigraph(const StaticDigraph &) : ExtendedStaticDigraphBase() {};
    1.19 +    /// \brief Assignment of a graph to another one is \e not allowed.
    1.20 +    /// Use DigraphCopy instead.
    1.21 +    void operator=(const StaticDigraph&) {}
    1.22 +
    1.23    public:
    1.24  
    1.25      typedef ExtendedStaticDigraphBase Parent;