Greg Mann created MESOS-5471:
--------------------------------

             Summary: Enable `Option` to handle string literals gracefully
                 Key: MESOS-5471
                 URL: https://issues.apache.org/jira/browse/MESOS-5471
             Project: Mesos
          Issue Type: Improvement
            Reporter: Greg Mann


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 *}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to