Details
-
Type:
Bug
-
Status: To Do
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: afw
-
Labels:
-
Story Points:2
-
Epic Link:
-
Team:Alert Production
Description
Calling MutableGenericMap::insert(K, T) with a C-style string literal as the value causes an insertion of a value of type const char*, which gets converted to bool. This confusing behavior is not changed by reordering the definition of GenericMap::StorableType so that std::string comes before bool.
The issue can be worked around by using C++11 string literals, or by using a strongly typed key.
Find if there's a way to cause C-strings to get converted to std::string in GenericMap. There may not be, as the conversion seems to be driven by C++ overload resolution rules.
I think this one can be solved with an Obvious Rules Patch: provide a (non-template?) overload that takes K and const char*, and have it delegate to the string template. We can solve a related issue with makeKey in the same way.