> On Feb. 27, 2019, 11:14 a.m., Benjamin Bannier wrote: > > Thanks for adding these! > > > > Like Ben said, let's link this to MESOS-7124. Let's additionally create a > > ticket linked there for writing a linter to catch uses of `get` where > > `operator*` should be used (this could be modelled based on the existing > > `mesos-redundant-get` linter).
Linked and filed MESOS-9617. > On Feb. 27, 2019, 11:14 a.m., Benjamin Bannier wrote: > > 3rdparty/stout/include/stout/option.hpp > > Lines 127 (patched) > > <https://reviews.apache.org/r/70067/diff/1/?file=2127187#file2127187line127> > > > > I feel we should disable this one for rvalues (which should also have > > been done for `T* operator->`). > > ``` > > T& operator*() & { return get(); } > > ``` Thanks for reviewing! I added rvalue versions for `*`. (except `Result` where a todo is added to add ref-qualified `get()` first). Looking at the `std::optional` (https://en.cppreference.com/w/cpp/utility/optional/operator*), both are allowed. Though I cannot think of a compelling use case, probably just for completeness. > On Feb. 27, 2019, 11:14 a.m., Benjamin Bannier wrote: > > 3rdparty/stout/include/stout/result.hpp > > Lines 138 (patched) > > <https://reviews.apache.org/r/70067/diff/1/?file=2127188#file2127188line138> > > > > Disable for rvalues? See my comment above. > On Feb. 27, 2019, 11:14 a.m., Benjamin Bannier wrote: > > 3rdparty/stout/include/stout/try.hpp > > Lines 82 (patched) > > <https://reviews.apache.org/r/70067/diff/1/?file=2127189#file2127189line82> > > > > Disable for rvalues? See my comment above. - Meng ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/70067/#review213266 ----------------------------------------------------------- On Feb. 27, 2019, 10:15 a.m., Meng Zhu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/70067/ > ----------------------------------------------------------- > > (Updated Feb. 27, 2019, 10:15 a.m.) > > > Review request for mesos, Benjamin Bannier and Benjamin Mahler. > > > Bugs: MESOS-7124 > https://issues.apache.org/jira/browse/MESOS-7124 > > > Repository: mesos > > > Description > ------- > > Added star operator for `Result`, `Try` and `Option`. > > > Diffs > ----- > > 3rdparty/stout/include/stout/option.hpp > 8feed012a55fed6eab89c883958324f3345e46e9 > 3rdparty/stout/include/stout/result.hpp > c1387ae957edffc31250b9b236b5f1fd8ff0acd3 > 3rdparty/stout/include/stout/try.hpp > 30cce7e27fa040d0ce5a86efc4820f8c39178444 > 3rdparty/stout/tests/option_tests.cpp > 815d40e0bf342998634dc69a1719c3f717c7202c > 3rdparty/stout/tests/result_tests.cpp > 1750e6b4a90afec3b7de0621779f8b69a856da41 > 3rdparty/stout/tests/try_tests.cpp 99b7b2a3f968abb87549fb9075d65bc5bcc827f1 > > > Diff: https://reviews.apache.org/r/70067/diff/2/ > > > Testing > ------- > > make check > > > Thanks, > > Meng Zhu > >