> On April 30, 2018, 11:57 p.m., Benjamin Mahler wrote:
> > 3rdparty/stout/include/stout/duration.hpp
> > Lines 28 (patched)
> > <https://reviews.apache.org/r/66841/diff/3/?file=2014540#file2014540line28>
> >
> >     Instead of pulling in boost here, can we just leverage the built-in 
> > hash for int64_t?
> >     
> >     http://en.cppreference.com/w/cpp/utility/hash
> >     
> >     I guess this looks like:
> >     
> >     ```
> >     #include <functional>
> >     
> >     ...
> >     
> >     namespace std {
> >     
> >     template <>
> >     struct hash<Duration>
> >     {
> >       typedef size_t result_type;
> >       typedef Duration argument_type;
> >     
> >       result_type operator()(const argument_type& d) const
> >       {
> >         return hash<int64_t>{}(d.ns());
> >       }
> >     };
> >     
> >     } // namespace std {
> >     ```

Good call, thanks Ben!


- Greg


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


On May 8, 2018, 11:18 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66841/
> -----------------------------------------------------------
> 
> (Updated May 8, 2018, 11:18 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gaston Kleiman, Gilbert Song, and 
> Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a hash function for 'Duration'.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp 
> 42c43cda21c75fc3bef962af67c4a09df68a95af 
> 
> 
> Diff: https://reviews.apache.org/r/66841/diff/4/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Greg Mann
> 
>

Reply via email to