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....
I get compile errors involving the following lines of code:
function_requires< IntegerConcept<ColorType> >(); function_requires< size_type, ReadablePropertyMapConcept<Order> >(); typedef typename same_type
::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