Boost logo

Boost Users :

Subject: Re: [Boost-users] [NEWBIE] [BGL] Compile error while using greedy graph coloring example v1.47.0
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-08-21 21:40:22


On Sun, 21 Aug 2011, Ragavendran Gopalakrishnan wrote:

> Hello all,
> I'm a newbie to using Boost Graph Libraries for my project. I was reading the documentation, and tried implementing the greedy graph coloring algorithm that is
> presented in the following webpage:
> http://www.boost.org/doc/libs/1_47_0/libs/graph/doc/constructing_algorithms.html
>
> I get compile errors involving the following lines of code:
>
> function_requires< IntegerConcept<ColorType> >();
> function_requires< size_type, ReadablePropertyMapConcept<Order> >();
> typedef typename same_type<OrderType, vertex_descriptor>::type req_same;
> I understand that the first two function_requires calls are concept checks, and I don't know what the use of the third line is, as req_same is never used. Anyway,
> if I comment these three lines, my program compiles fine, and works perfectly. I am unable to understand the errors and correct them. 

Those parts of the code are designed to check for usage errors of the
algorithm, but the second and third of them are incorrect. You also pass
a pointer to an std::map into your algorithm, rather than turning it into
a property map using make_assoc_property_map. I have attached a corrected
version of the code; you might want to diff it against your version to see
what's been changed.

-- Jeremiah Willcock



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net