-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52062/#review149638
-----------------------------------------------------------
We currently simply inherit the negation of unsigned int behavior from
`boost::lexical_cast`.
i.e., `numify<unsigned int>("-1") == std::numeric_limits<unsigned int>::max()`
The current code for hexadecimals maintains this behavior whereas this patch
does not.
i.e., `numify<unsigned int>("-0x1") == 0x1`.
I think that we should either:
- maintain the original behavior by simply silencing the MSVC warning, or
- return an `Error` in the case where `T` is unsigned and
`strings::startsWith(s, '-')` is `true`.
NOTE: this should be done at the top of the function, so that we have
consistent behavior for non-hexadecimals as well.
- Michael Park
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
>
>