COIN-OR::LEMON - Graph Library

Ticket #364: 364-undirfn-dc376822c17d.patch

File 364-undirfn-dc376822c17d.patch, 966 bytes (added by Peter Kovacs, 14 years ago)
  • lemon/core.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1270503665 -7200
    # Node ID dc376822c17d7053ff8b611e835bfdebb3286591
    # Parent  87569cb5734dee71de7e2c449c1cd6500921e2a7
    Add an undirected() function (#364)
    
    diff --git a/lemon/core.h b/lemon/core.h
    a b  
    445445
    446446  }
    447447
     448  /// Check whether a graph is undirected.
     449  ///
     450  /// This function returns \c true if the given graph is undirected.
     451#ifdef DOXYGEN
     452  template <typename GR>
     453  bool undirected(const GR& g) { return false; }
     454#else
     455  template <typename GR>
     456  typename enable_if<UndirectedTagIndicator<GR>, bool>::type
     457  undirected(const GR&) {
     458    return true;
     459  }
     460  template <typename GR>
     461  typename disable_if<UndirectedTagIndicator<GR>, bool>::type
     462  undirected(const GR&) {
     463    return false;
     464  }
     465#endif
     466
    448467  /// \brief Class to copy a digraph.
    449468  ///
    450469  /// Class to copy a digraph to another digraph (duplicate a digraph). The