diff --git a/lemon/bits/traits.h b/lemon/bits/traits.h --- a/lemon/bits/traits.h +++ b/lemon/bits/traits.h @@ -29,117 +29,123 @@ struct InvalidType {}; - template + template class ItemSetTraits {}; - template + template struct NodeNotifierIndicator { typedef InvalidType Type; }; - template + template struct NodeNotifierIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { - typedef typename Graph::NodeNotifier Type; + typedef typename GR::NodeNotifier Type; }; - template - class ItemSetTraits<_Graph, typename _Graph::Node> { + template + class ItemSetTraits { public: - typedef _Graph Graph; + typedef GR Graph; + typedef GR Digraph; - typedef typename Graph::Node Item; - typedef typename Graph::NodeIt ItemIt; + typedef typename GR::Node Item; + typedef typename GR::NodeIt ItemIt; - typedef typename NodeNotifierIndicator::Type ItemNotifier; + typedef typename NodeNotifierIndicator::Type ItemNotifier; - template - class Map : public Graph::template NodeMap<_Value> { + template + class Map : public GR::template NodeMap { + typedef typename GR::template NodeMap Parent; + public: - typedef typename Graph::template NodeMap<_Value> Parent; - typedef typename Graph::template NodeMap<_Value> Type; + typedef typename GR::template NodeMap Type; typedef typename Parent::Value Value; - Map(const Graph& _digraph) : Parent(_digraph) {} - Map(const Graph& _digraph, const Value& _value) + Map(const GR& _digraph) : Parent(_digraph) {} + Map(const GR& _digraph, const Value& _value) : Parent(_digraph, _value) {} }; }; - template + template struct ArcNotifierIndicator { typedef InvalidType Type; }; - template + template struct ArcNotifierIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { - typedef typename Graph::ArcNotifier Type; + typedef typename GR::ArcNotifier Type; }; - template - class ItemSetTraits<_Graph, typename _Graph::Arc> { + template + class ItemSetTraits { public: - typedef _Graph Graph; + typedef GR Graph; + typedef GR Digraph; - typedef typename Graph::Arc Item; - typedef typename Graph::ArcIt ItemIt; + typedef typename GR::Arc Item; + typedef typename GR::ArcIt ItemIt; - typedef typename ArcNotifierIndicator::Type ItemNotifier; + typedef typename ArcNotifierIndicator::Type ItemNotifier; - template - class Map : public Graph::template ArcMap<_Value> { + template + class Map : public GR::template ArcMap { + typedef typename GR::template ArcMap Parent; + public: - typedef typename Graph::template ArcMap<_Value> Parent; - typedef typename Graph::template ArcMap<_Value> Type; + typedef typename GR::template ArcMap Type; typedef typename Parent::Value Value; - Map(const Graph& _digraph) : Parent(_digraph) {} - Map(const Graph& _digraph, const Value& _value) + Map(const GR& _digraph) : Parent(_digraph) {} + Map(const GR& _digraph, const Value& _value) : Parent(_digraph, _value) {} }; }; - template + template struct EdgeNotifierIndicator { typedef InvalidType Type; }; - template + template struct EdgeNotifierIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { - typedef typename Graph::EdgeNotifier Type; + typedef typename GR::EdgeNotifier Type; }; - template - class ItemSetTraits<_Graph, typename _Graph::Edge> { + template + class ItemSetTraits { public: - typedef _Graph Graph; + typedef GR Graph; + typedef GR Digraph; - typedef typename Graph::Edge Item; - typedef typename Graph::EdgeIt ItemIt; + typedef typename GR::Edge Item; + typedef typename GR::EdgeIt ItemIt; - typedef typename EdgeNotifierIndicator::Type ItemNotifier; + typedef typename EdgeNotifierIndicator::Type ItemNotifier; - template - class Map : public Graph::template EdgeMap<_Value> { + template + class Map : public GR::template EdgeMap { + typedef typename GR::template EdgeMap Parent; + public: - typedef typename Graph::template EdgeMap<_Value> Parent; - typedef typename Graph::template EdgeMap<_Value> Type; + typedef typename GR::template EdgeMap Type; typedef typename Parent::Value Value; - Map(const Graph& _digraph) : Parent(_digraph) {} - Map(const Graph& _digraph, const Value& _value) + Map(const GR& _digraph) : Parent(_digraph) {} + Map(const GR& _digraph, const Value& _value) : Parent(_digraph, _value) {} }; @@ -204,93 +210,93 @@ // Indicators for the tags - template + template struct NodeNumTagIndicator { static const bool value = false; }; - template + template struct NodeNumTagIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { static const bool value = true; }; - template + template struct ArcNumTagIndicator { static const bool value = false; }; - template + template struct ArcNumTagIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { static const bool value = true; }; - template + template struct EdgeNumTagIndicator { static const bool value = false; }; - template + template struct EdgeNumTagIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { static const bool value = true; }; - template + template struct FindArcTagIndicator { static const bool value = false; }; - template + template struct FindArcTagIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { static const bool value = true; }; - template + template struct FindEdgeTagIndicator { static const bool value = false; }; - template + template struct FindEdgeTagIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { static const bool value = true; }; - template + template struct UndirectedTagIndicator { static const bool value = false; }; - template + template struct UndirectedTagIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { static const bool value = true; }; - template + template struct BuildTagIndicator { static const bool value = false; }; - template + template struct BuildTagIndicator< - Graph, - typename enable_if::type + GR, + typename enable_if::type > { static const bool value = true; };