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:09:32 GMT

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


Fix it, then Ship it!





3rdparty/stout/include/stout/result.hpp
Lines 128 (patched)
<https://reviews.apache.org/r/70123/#comment299387>

    Maybe worth adding a comment that this is not a member function so we can decouple us
from the `const`-ness of `this` (if I follow the reasoning correctly).



3rdparty/stout/include/stout/result.hpp
Lines 129 (patched)
<https://reviews.apache.org/r/70123/#comment299385>

    ```
    -> decltype(std::forward<Self>(self)
                  .data
                  .get() // NOLINT(mesos-redundant-get)
                  .get())
    ```
    
    See below.



3rdparty/stout/include/stout/result.hpp
Line 126 (original), 140 (patched)
<https://reviews.apache.org/r/70123/#comment299384>

    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();
    ```



3rdparty/stout/include/stout/result.hpp
Line 131 (original)
<https://reviews.apache.org/r/70123/#comment299386>

    Great we were able to get rid of this!


- Benjamin Bannier


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