mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Re: Review Request 70123: Added rvalue overload for `Result::get()`.
Date Tue, 05 Mar 2019 22:25:30 GMT


> On March 5, 2019, 11:09 p.m., Benjamin Bannier wrote:
> > 3rdparty/stout/include/stout/result.hpp
> > Line 126 (original), 140 (patched)
> > <https://reviews.apache.org/r/70123/diff/2/?file=2128782#file2128782line140>
> >
> >     The `mesos-redundant-get` clang-tidy check will incorrectly suggest to use `std::forward<Self>(self).data->get()`
here which I am not sure how to fix (this function will work on both rvalue and lvalue `self`
values which AFAICT don't propagate the same way through `operator->`.
> >     
> >     I'd suggest we add a linter suppression here for now until we possibly get rid
of `get` in favor of `operator*` for good.
> >     ```
> >     return std::forward<Self>(self)
> >       .data
> >       .get() // NOLINT(mesos-redundant-get)
> >       .get();
> >     ```

Actually there's also `NOLINTNEXTLINT` which would allow us to keep the expression on a single
line, e.g.,
```
// NOTLINENEXTLINE(mesos-redundant-get)
return std::forward<Self>(self).data.get().get()
```

Also above.


- Benjamin


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


On March 5, 2019, 12:53 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70123/
> -----------------------------------------------------------
> 
> (Updated March 5, 2019, 12:53 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added rvalue overload for `Result::get()`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/result.hpp c1387ae957edffc31250b9b236b5f1fd8ff0acd3 
> 
> 
> Diff: https://reviews.apache.org/r/70123/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


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