mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Wu <jos...@mesosphere.io>
Subject Re: Review Request 64729: Made `Duration::operator*` accept `int` and `size_t`.
Date Fri, 05 Jan 2018 22:14:55 GMT

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




3rdparty/stout/include/stout/duration.hpp
Lines 173 (patched)
<https://reviews.apache.org/r/64729/#comment273992>

    Why sacrifice the precision of integer * integer multiplication?
    
    ```
    nanos = nanos * multiplier;
    ```
    (You might need to `friend` one of these operators to get this to work)
    
    Same with the other operator.


- Joseph Wu


On Jan. 5, 2018, 1:53 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64729/
> -----------------------------------------------------------
> 
> (Updated Jan. 5, 2018, 1:53 p.m.)
> 
> 
> Review request for mesos, Greg Mann, Jie Yu, Joseph Wu, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Without this change, every use of `Duration * 2` throws a conversion
> warning because we multiple `Duration` by `int` and `size_t` without
> casting to `double` (the type accepted by the actual implementation of
> `operator*`).
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp d10b6a4d4d1a0096334c30fdec725ecc55c9f0ea

> 
> 
> Diff: https://reviews.apache.org/r/64729/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


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