You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benjamin Bannier (JIRA)" <ji...@apache.org> on 2016/09/14 10:19:20 UTC
[jira] [Commented] (MESOS-5072) Add variadic constructor for Option
[ https://issues.apache.org/jira/browse/MESOS-5072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15490061#comment-15490061 ]
Benjamin Bannier commented on MESOS-5072:
-----------------------------------------
Are you still working on this [~a10gupta]? If not please unassign yourself.
> 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
> Assignee: Abhishek Dasgupta
>
> 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)