#6543 closed Bugs (wontfix)
identity_property_map is not overloaded for any key type
Reported by: | 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)
Change History (3)
by , 11 years ago
Attachment: | property_map_hpp.patch added |
---|
comment:1 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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 , 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
patch to property_map.hpp