Boost logo

Boost Users :

From: Irek Szczesniak (ijs_at_[hidden])
Date: 2006-04-17 03:06:43


Hi Daniel,

Thank you for your email.

>>In nutshell: how can I check whether a property map has some given
>>key?
>
> Some property maps may provide bounds checking, but the property map
> concept doesn't require it, so in general you can't.

Good to know. I didn't find this in the property map documentation.

> I think you'll need to give every edge a lambda number, but you
> might reserve a special value to indicate that the lambda property
> isn't applicable to that edge.

I had the class def_int as the type of the lambda property:

struct def_int
{
   int value;

   def_int() : value(-1) {}

   def_int & operator = (int a)
   {
     value = a;
   }

   bool operator < (const def_int &a)
   {
     return value < a.value;
   }
};

In this way if a link doesn't have this property, then the property
map has -1 for that edge. The problem is that I needed to define
operators =, <, <<, >> to make it work. Then I wanted to use some
other stuff and got cryptic error messages at compilation.

Finally I dropped the def_int class in favor of the int type, and now
I make sure that every link in the .dot file has a lambdas property.

Best,
Irek


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