You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Bannier <be...@mesosphere.io> on 2017/01/30 21:21:13 UTC

Re: Review Request 53252: Added `hashset` constructor for type that supports `begin()/end()`.

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




3rdparty/stout/include/stout/hashset.hpp (lines 74 - 80)
<https://reviews.apache.org/r/53252/#comment235026>

    `std::set` already defines a constructor taking a range, so I'd suggest not reimplementing it here, but instead to simply inherit the base class' constructors,
    
        using std::unordered_set<Elem, Hash, Equal>::unordered_set;
        
    Note that this makes the constructor taking an `std::initializer_list` redundant, so it should be removed.
        
    Note that this would allow us to simplify existing constructors with even less typing, e.g.,
    
        hashset(const std::set& set) : hashset(set.begin(), set.end()) {}
        
    and similar.


- Benjamin Bannier


On Oct. 28, 2016, 7:12 a.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53252/
> -----------------------------------------------------------
> 
> (Updated Oct. 28, 2016, 7:12 a.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jie Yu, Qian Zhang, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-6035
>     https://issues.apache.org/jira/browse/MESOS-6035
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add `hashset` constructor for any arbitrary type that supports
> `begin()` and `end()`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/hashset.hpp 8f633cad4d27c1e5f391279b7f3e8cb5fbf4bd03 
> 
> Diff: https://reviews.apache.org/r/53252/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> haosdent huang
> 
>