COIN-OR::LEMON - Graph Library

Ticket #606: static_graph_constructor.2.patch

File static_graph_constructor.2.patch, 1.1 KB (added by Peter Kovacs, 4 years ago)
  • lemon/static_graph.h

    # HG changeset patch
    # User Gabriel Gouvine <gabriel.gouvine.GIT@gmx.com>
    # Date 1485545713 -3600
    #      Fri Jan 27 20:35:13 2017 +0100
    # Node ID fd04b9f2058dc6979eb27fe01835b9e5c38e9034
    # Parent  f51c01a1b88eead63515a8b22f6f380595245a42
    Forbid copy construction of StaticDigraph
    
    diff -r f51c01a1b88e -r fd04b9f2058d lemon/static_graph.h
    a b  
    2929namespace lemon {
    3030
    3131  class StaticDigraphBase {
     32
    3233  public:
    3334
    3435    StaticDigraphBase()
     
    296297  ///
    297298  /// \sa concepts::Digraph
    298299  class StaticDigraph : public ExtendedStaticDigraphBase {
     300
     301  private:
     302    /// Graphs are \e not copy constructible. Use DigraphCopy instead.
     303    StaticDigraph(const StaticDigraph &) : ExtendedStaticDigraphBase() {};
     304    /// \brief Assignment of a graph to another one is \e not allowed.
     305    /// Use DigraphCopy instead.
     306    void operator=(const StaticDigraph&) {}
     307
    299308  public:
    300309
    301310    typedef ExtendedStaticDigraphBase Parent;