You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Alexander Rojas <al...@mesosphere.io> on 2017/11/07 15:26:39 UTC
Re: Review Request 63292: Added lamdba::zip.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63292/#review190310
-----------------------------------------------------------
3rdparty/stout/include/stout/lambda.hpp
Lines 168 (patched)
<https://reviews.apache.org/r/63292/#comment267599>
why not use a `std::tuple` instead of `std::pair`? that will allow to expand this function eventually to any number of inputs.
3rdparty/stout/include/stout/lambda.hpp
Lines 209-221 (patched)
<https://reviews.apache.org/r/63292/#comment267604>
Why not replace this with:
```c++
std::unordered_map<U1, U2> output;
auto contents = zipto<std::vector>(input1, input2);
std::copy(
std::begin(contents),
std::end(contents),
std::inserter(output, std::begin(output)));
return output;
```
If we had ranges we could even get away without `contents`.
- Alexander Rojas
On Oct. 25, 2017, 12:03 p.m., Benjamin Hindman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63292/
> -----------------------------------------------------------
>
> (Updated Oct. 25, 2017, 12:03 p.m.)
>
>
> Review request for mesos, Alexander Rojas and Vinod Kone.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Added lamdba::zip.
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/lambda.hpp a61d97b69e7eebd057c94148d39c6e1fc3066017
> 3rdparty/stout/tests/lambda_tests.cpp ad8c2efddb6b64184670d0cfb33188ef843351ab
>
>
> Diff: https://reviews.apache.org/r/63292/diff/1/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Benjamin Hindman
>
>