# HG changeset patch # User Peter Kovacs # Date 1270503665 -7200 # Node ID dc376822c17d7053ff8b611e835bfdebb3286591 # Parent 87569cb5734dee71de7e2c449c1cd6500921e2a7 Add an undirected() function (#364) diff -r 87569cb5734d -r dc376822c17d lemon/core.h --- a/lemon/core.h Wed Mar 17 14:05:23 2010 +0100 +++ b/lemon/core.h Mon Apr 05 23:41:05 2010 +0200 @@ -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