Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-5471

Enable `Option` to handle string literals gracefully

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • 2

    Description

      In FlagsBase::add, MESOS-5064 begins making use of template function parameters like T2* for the default flag value rather than Option<T2>&. This is because in some places in the code base, we pass string literals for this argument. If an Option type is used, the compiler infers a char [x] type for T2, which breaks Option::getOrElse, which attempts to return that same type, since returning arrays is disallowed.

      To fix this, we could employ std::decay, which would convert a return type of char [x] into const char *.

      Attachments

        Activity

          People

            Unassigned Unassigned
            greggomann Greg Mann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: