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


Hi Alex,
I just wanted to follow up on our conversation.
As discussed, I think it makes sense to refactor to use `std::unordered_set<>` 
first.
After that, I think you can simplify this code significantly:
```
hashset(const std::set<Elem> &set) : std::unordered_set<Elem, Hash, 
Equal>(set.begin(), set.end(), std::ceil(list.size() / max_load_factor())) {}

hashset(std::initializer_list<Elem> list) : std::unordered_set<Elem, Hash, 
Equal>(list.begin(), list.end(), std::ceil(list.size() / max_load_factor())) {}
```

The move constructor is a little trickier, let's discuss that one :-)

- Joris Van Remoortere


On June 25, 2015, 1:45 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35874/
> -----------------------------------------------------------
> 
> (Updated June 25, 2015, 1:45 p.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Joerg Schad, Michael Park, and Till 
> Toenshoff.
> 
> 
> Bugs: MESOS-2924
>     https://issues.apache.org/jira/browse/MESOS-2924
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds extra template parameters to hashset as well as implicit constructors 
> from
> `std::set` and a initializer list constructor.
> 
> These changes keep hashset up to date with the changes in hashmap.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/hashset.hpp 
> 75ed9db54dc9ab502e978f06c55a621cacb56b91 
>   3rdparty/libprocess/3rdparty/stout/tests/hashset_tests.cpp 
> 3c4b732432c0c155451d34ecd5f985318d118fe5 
> 
> Diff: https://reviews.apache.org/r/35874/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>

Reply via email to