Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6543 closed Bugs (wontfix)

identity_property_map is not overloaded for any key type

Reported by: Alex Hagen-Zanker <ahh34@…> Owned by:
Milestone: To Be Determined Component: None
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

The following assertion fails, because a is first cast to size_t and then to double. Leaving us with a = 0.5 and b = 0.0

boost::identity_property_map identity; double a = 0.5; double b = get(identity, a); assert(a==b);

I am submitting a patch that introduces (reinstates?) the overloads that are promised in the documentation.

The patch contains an additional property map: identity_ref_property_map, which is a identity_property_map that returns a reference to the key, instead of a copy of the key.

Including that struct is up to your discretion, it is not really part of the patch.

Attachments (1)

property_map_hpp.patch (1.9 KB ) - added by Alex Hagen-Zanker <ahh34@…> 11 years ago.
patch to property_map.hpp

Download all attachments as: .zip

Change History (3)

by Alex Hagen-Zanker <ahh34@…>, 11 years ago

Attachment: property_map_hpp.patch added

patch to property_map.hpp

comment:1 by Jeremiah Willcock, 11 years ago

Resolution: wontfix
Status: newclosed

There is a typed_identity_property_map that does what you want; identity_property_map is deprecated for exactly the reasons that you mention.

comment:2 by Alex Hagen-Zanker, 11 years ago

Ok, if identity_property_map is deprecated, than the code can remain as it is. It does mean that the documentation is outdated. When I have a chance I will see if I can correct the page on identity_property_map

Note: See TracTickets for help on using tickets.