mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <bmah...@apache.org>
Subject Review Request 68813: Added support for `Option<T&>` / `Option<const T&>`.
Date Sun, 23 Sep 2018 01:09:39 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68813/
-----------------------------------------------------------

Review request for mesos, Benjamin Bannier, Benno Evers, and Michael Park.


Bugs: MESOS-9252
    https://issues.apache.org/jira/browse/MESOS-9252


Repository: mesos


Description
-------

This adds support for options of references. While this is still
under debate for `std::optional`, there are some use cases in
stout that can benefit from this:

  // None if the value is not found, otherwise a reference
  // to the value.
  Option<T&> t = hashmap.get("key");

Assignment and equality are deleted in order to avoid confusion
around which of the 2 possible behaviors they provide (e.g. are
the references being compared? or are the objects being referred
to being compared?)


Diffs
-----

  3rdparty/stout/include/stout/option.hpp 8feed012a55fed6eab89c883958324f3345e46e9 


Diff: https://reviews.apache.org/r/68813/diff/1/


Testing
-------

Test added in subsequent patch.


Thanks,

Benjamin Mahler


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message