mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Park <mp...@apache.org>
Subject Re: Review Request 54110: Added `process::loop` abstraction.
Date Tue, 29 Nov 2016 20:19:51 GMT

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




3rdparty/libprocess/include/process/loop.hpp (lines 126 - 127)
<https://reviews.apache.org/r/54110/#comment227873>

    Do you want these to be by value?
    
    This code as-is, `Iterate` and `Body` can be l-value references.
    
    In the `loop` implementation below, we do something like:
    
    ```cpp
    template <typename Iterate, typename Body>
    Future<Nothing> loop(const UPID& pid, Iterate&& iterate, Body&&
body)
    {
      /* ... */
      
      Owned<internal::Loop<Iterate, Body, T>> loop(/* ... */);
    }
    ```
    
    `Iterate&&` (and `Body&&`) are forwarding references here, which means
that `Iterate` can be deduced to be an l-value reference.
    If you want to store them by value, the standard practice here is to pass `typename std::decay<Iterate>::type`
to `Loop`.


- Michael Park


On Nov. 28, 2016, 10:33 a.m., Benjamin Hindman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54110/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 10:33 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added `process::loop` abstraction.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/Makefile.am 71319891a451bd1d565210dcce2fb61fc69e1f61 
>   3rdparty/libprocess/include/process/loop.hpp PRE-CREATION 
>   3rdparty/libprocess/src/tests/loop_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/54110/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>


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