mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhishek Dasgupta (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MESOS-5072) Add variadic constructor for Option
Date Wed, 14 Sep 2016 16:07:21 GMT

     [ https://issues.apache.org/jira/browse/MESOS-5072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Abhishek Dasgupta updated MESOS-5072:
-------------------------------------
    Assignee:     (was: Abhishek Dasgupta)

> Add variadic constructor for Option
> -----------------------------------
>
>                 Key: MESOS-5072
>                 URL: https://issues.apache.org/jira/browse/MESOS-5072
>             Project: Mesos
>          Issue Type: Improvement
>          Components: stout
>            Reporter: Benjamin Bannier
>
> Currently an {{Option<T>}} can be constructed from an {{U}} if in turn a {{T}}
is constructable from an {{U}}, e.g.,
> {code}
> // Construct a std::string from a string literal.
> Option<string> s{"fnord"};
> {code}
> We should extend this to permit this kind of construct from more than one parameter,
i.e.,
> {code}
> // Construct a vector of strings from a string initializer list.
> Option<vector<string>> v{"Browny", "Whitey", "Blacky"};
> {code}
> Currently users need to duplicate the type which e.g., poses the danger of
> inadvertently type conversions,
> {code}
> Option<vector<string>> v{<vector<string>>{"Browny", "Whitey",
"Blacky"}};
> {code}
> It seems just making the {{U}} in the respective {{Option}} constructor
> variadic would already be enough to support this, but it would be highly
> desirable to remove explicit, redundant types in existing constructions of {{Options}}
in the code base.



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

Mime
View raw message