Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-21216

GenericMap converts C-strings to bool

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
    • Templates:
    • Story Points:
      2
    • 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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                krzys Krzysztof Findeisen
                Reporter:
                krzys Krzysztof Findeisen
                Watchers:
                Krzysztof Findeisen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel