PolyLineT::get_custom_property Behaving Somewhat Unexpectedly
The get_custom_property method of the PolyLineT class comes in the two following variants:
typedef void* CustomPropertyHandle;
// property access by handle (byte-wise)
void get_custom_property(CustomPropertyHandle _property_handle, unsigned int _vertex, void* _dst) const;
// property access by name (byte-wise), (slower than by handle)
void get_custom_property(const std::string& _name, unsigned int _vertex, void* _dst) const;
Note that the CustomPropertyHandle
is defined as void*
.
This causes a call to get_custom_property("foo", ....)
to be handled with the first variant. My guess is that the "foo"
literal is in this case interpreted as a char array and implicitely casted to void*
with higher precedence than std::string
.
I claim that this is undesired behavior and ask to investigate alternative solutions.
The same problem should apply for related methods set_custom_property
, custom_property_available
and release_custom_property
.
The problem was observed with the Microsoft Visual Studio 2013 compiler.