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/02/18 10:12:18 UTC
[jira] [Created] (MESOS-4706) Option should provide symmetric
comparison operators
Benjamin Bannier created MESOS-4706:
---------------------------------------
Summary: Option should provide symmetric comparison operators
Key: MESOS-4706
URL: https://issues.apache.org/jira/browse/MESOS-4706
Project: Mesos
Issue Type: Improvement
Components: stout
Reporter: Benjamin Bannier
Currently {{Option}} provides comparison operators as members functions. This means that in any comparison the lhs must always be an {{Option}} for operators to be triggered, e.g., for {{operator==}}
{code}
Option<int>(1) == 1; // (1) works
1 == Option<int>(1); // (2) doesn't work ("invalid operands to binary expression ('int' and 'Option<int>')")
{code}
The same problem exists for {{operator!=}}.
{{EXPECT_EQ}} and {{EXPECT_NE}} interpret their first argument as an expected value, and the second one as the actual one; this requires support for variant {{(2)}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)