function dispatch mismatch in graph_traits

Hi, I am having trouble making leda_graph wrapper for GRAPH<vtype, etype> class. In leda_graph.hpp the wrapper is defined as template<class vtype, class etype> ... vertices(const leda::GRAPH<vtype, etype>& g) { do_something; } Given this definition the right (and only way i think) to invoke it by expression vertices<vtype, etype>(G) My problem is that all internal graph routines invoke the function by expression vertices(G) I would appreciate any ideas about how can i redirect vertices(G) to vertices<vtype, etype>(G) where vtype = vrec etype = erec G = leda::GRAPH<vrec, erec> I am afraid that i might have to rewrite a wrapper for specifically leda::GRAPH<vrec, erec>. Can this be avoided. Thanks sandeep

on Sun Feb 08 2009, Sandeep Gupta <gupta.sandeep-AT-gmail.com> wrote:
Hi, I am having trouble making leda_graph wrapper for GRAPH<vtype, etype> class. In leda_graph.hpp the wrapper is defined as
template<class vtype, class etype> ... vertices(const leda::GRAPH<vtype, etype>& g) { do_something; }
Given this definition the right (and only way i think) to invoke it by expression vertices<vtype, etype>(G)
Try vertices(G)
My problem is that all internal graph routines invoke the function by expression vertices(G)
That shouldn't be a problem as long as leda_graph.hpp is #included *before* any boost graph algorithm that might invoke vertices(G). -- Dave Abrahams BoostPro Computing http://www.boostpro.com

On Sun, Feb 8, 2009 at 8:06 AM, David Abrahams <dave@boostpro.com> wrote:
on Sun Feb 08 2009, Sandeep Gupta <gupta.sandeep-AT-gmail.com> wrote:
Hi, I am having trouble making leda_graph wrapper for GRAPH<vtype, etype> class. In leda_graph.hpp the wrapper is defined as
template<class vtype, class etype> ... vertices(const leda::GRAPH<vtype, etype>& g) { do_something; }
Given this definition the right (and only way i think) to invoke it by expression vertices<vtype, etype>(G)
Try
vertices(G)
My problem is that all internal graph routines invoke the function by expression vertices(G)
That shouldn't be a problem as long as leda_graph.hpp is #included *before* any boost graph algorithm that might invoke vertices(G).
--
Thanks David. It works. leda_graph.hpp had to be included before other headers.
Dave Abrahams BoostPro Computing http://www.boostpro.com _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
David Abrahams
-
Sandeep Gupta