----------------------------------------------------------- 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 > >
