Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Bundled properties and property maps
From: Geoff Hilton (geoff.hilton_at_[hidden])
Date: 2009-01-14 19:47:19


Andrew Sutton wrote:
>
> On Tue, Jan 13, 2009 at 9:56 AM, Andrew Sutton
> <andrew.n.sutton_at_[hidden] <mailto:andrew.n.sutton_at_[hidden]>> wrote:
>
> Hi Andrew, apologies for writing directly to you, I just thought
> I'd try to get your attention this way since you hadn't yet
> replied to my last post on the above topic in the mailing list.
>
>
> Sorry about that, I've been swamped since new years. I'm going to
> bounce this back to the list
>
> I would avoid declaring property maps as const. Somewhere in your
> posted code you have:
>
> const property_map<...>::const_type map; // or something similar.
>
> For all property maps, map = get(...) is a valid expression,
> regardless of whether your map is a ::type or ::const_type. By
> declaring it const, and then instantiating a template with the const
> pmap, you're going to run into problems - probably the problem you
> reported earlier.
>
> Andrew Sutton
> andrew.n.sutton_at_[hidden]

Okay, so if I understand correctly I shouldn't use const prop maps with
const_type at all?

It seems to me like a line such as the above should still theoretically
compile. At least from the perspective of a concept check for
Readability; this is by definition what const is meant to restrict
objects to so in theory in should be allowable no? If I'm right it would
be a compilation error caused by the underlying implementation. Either
that or a debatable foible that should be documented? *shrug*.

Thanks,
Geoff


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