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 52062: Fixed warnings in `numify.hpp`.
Date Tue, 20 Sep 2016 10:22:47 GMT


> On Sept. 19, 2016, 9:24 p.m., Joseph Wu wrote:
> > 3rdparty/stout/include/stout/numify.hpp, lines 29-32
> > <https://reviews.apache.org/r/52062/diff/1/?file=1503001#file1503001line29>
> >
> >     Couldn't this be a static assert (failure) instead?  
> >     
> >     It doesn't make sense to negate an unsigned value.

No, if we were to put a `static_assert` here, it would cause an error when `numify` is used
with any unsigned types.
That is, `numify<unsigned int>` will always fail to compile. It's due to the fact that
we obviously can't know whether `std::string` will start with a `-` or not at compile-time.


- Michael


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


On Sept. 19, 2016, 8:05 p.m., Daniel Pravat wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52062/
> -----------------------------------------------------------
> 
> (Updated Sept. 19, 2016, 8:05 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Artem Harutyunyan, Alex Clemmer, Joseph Wu, and
Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When the template is instatiated for unsigned scalars
> the unary negation generates warnings.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/numify.hpp c174fcb8cb9d809f443e44058f07b58751bed9dd 
> 
> Diff: https://reviews.apache.org/r/52062/diff/
> 
> 
> Testing
> -------
> 
> Windows: build
> 
> 
> Thanks,
> 
> Daniel Pravat
> 
>


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