mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <bbann...@apache.org>
Subject Re: Review Request 63410: Added a general hash function for Option<T>.
Date Mon, 30 Oct 2017 14:52:43 GMT


> On Oct. 30, 2017, 3:39 p.m., Benjamin Bannier wrote:
> > 3rdparty/stout/include/stout/option.hpp
> > Lines 233-234 (patched)
> > <https://reviews.apache.org/r/63410/diff/1/?file=1872635#file1872635line233>
> >
> >     I believe we can simplify this since `boost::hash_combine` is already templated
on the type of the second argument and will call the correct hash function automatically,
> >     
> >         boost::hash_combine(seed, option.get());

I am dropping this since `boost::hash_combine` does not invoke `std::hash<T>`, but instead
`boost::hash_value<T>`. That means that that while it works for types Boost knows about
(e.g., `int` in your test), it does not work for custom types introduced by us.


- Benjamin


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


On Oct. 30, 2017, 3:27 p.m., Jie Yu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63410/
> -----------------------------------------------------------
> 
> (Updated Oct. 30, 2017, 3:27 p.m.)
> 
> 
> Review request for mesos and Benjamin Bannier.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a general hash function for Option<T>.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/option.hpp 0ff6a857b737e893df4516807de50d2ed958b2ae 
>   3rdparty/stout/tests/option_tests.cpp 73b03b097d24da9063eb7ce45d33a7dc411f653d 
> 
> 
> Diff: https://reviews.apache.org/r/63410/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>


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