> On June 30, 2015, 11:55 p.m., Joris Van Remoortere wrote: > > 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 :-)
Hey Joris, I've filed [MESOS-3217](https://issues.apache.org/jira/browse/MESOS-3217) to capture the work involved in our transition from boost `unordered_{set,map}` and `hash` to their standard counterparts. Meanwhile, I've committed this patch to keep `hashset` and `hashmap` APIs consistent. - Michael ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35874/#review89982 ----------------------------------------------------------- On July 7, 2015, 8:51 a.m., Alexander Rojas wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35874/ > ----------------------------------------------------------- > > (Updated July 7, 2015, 8:51 a.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 > >