Boost logo

Boost Users :

Subject: Re: [Boost-users] PropertyGraphConcept concept checking errors for an example implicit graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-06-25 10:02:35


On Thu, 24 Jun 2010, W.P. McNeill wrote:

> Thanks for your help.  Getting a little closer.
> Once I get the edge properties working I'll look at traversal concepts other than AdjacencyGraphs.  So far this has been the easy part for me.
>
> I have been looking at the grid graph, but I couldn't figure out how to add weights to the edges of a grid graph.  I can't find a simple example of an implicit
> graph with properties.  (Which is why I'm trying to write one now.)
>
> What do you mean by "Write an empty struct that inherits from all of the ones that you are going to model"?  I didn't think there were concept base classes to
> inherit from.
>
> Changing the property typedef in the implicit graph struct to 
>
>     typedef boost::property<boost::edge_weight_t, float> edge_property_type;
>
> making the get() functions take constant graph object references, and checking against the ReadablePropertyGraphConcept improves the compilation.  I now no longer
> have pages of errors, which makes me think I'm on the right track.
>
> I still have two errors, both of which I'm confused about.
>
> 1. graph_concepts.hpp:390: error: conversion from ‘EdgeWeightMap’ to non-scalar type ‘boost::typed_identity_property_map<size_t>’ requested
>
> This is the same as before.  This error makes me feel like I've got the wrong return value for one of my get() functions, but after double-checking they look
> right.

That does seem odd; could you please send the full error message list
(including instantiation stacks)?

> 2. property_map.hpp:318: error: no match for ‘operator[]’ in ‘(const boost::typed_identity_property_map<size_t>&)((const
> boost::typed_identity_property_map<size_t>*)(& pa))[k]’
>
> I didn't think any concept required operator[], so I'm not sure why this is happening.  Line 318 is inside the inline get() function of the put_get_helper(), but
> I'm not using put_get_helper() in my code.

This is probably from the same confusion that triggered the previous
error; it looks like one of the concept checks is testing against
MutableLvaluePropertyMapConcept (which does require operator[]), but I
can't tell why off-hand.

-- 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