# HG changeset patch # User Peter Kovacs # Date 2010-04-05 23:41:05 # Node ID dc376822c17d7053ff8b611e835bfdebb3286591 # Parent 87569cb5734dee71de7e2c449c1cd6500921e2a7 Add an undirected() function (#364) diff --git a/lemon/core.h b/lemon/core.h --- a/lemon/core.h +++ b/lemon/core.h @@ -445,6 +445,25 @@ } + /// Check whether a graph is undirected. + /// + /// This function returns \c true if the given graph is undirected. +#ifdef DOXYGEN + template + bool undirected(const GR& g) { return false; } +#else + template + typename enable_if, bool>::type + undirected(const GR&) { + return true; + } + template + typename disable_if, bool>::type + undirected(const GR&) { + return false; + } +#endif + /// \brief Class to copy a digraph. /// /// Class to copy a digraph to another digraph (duplicate a digraph). The