> On June 30, 2016, 12:59 a.m., Klaus Ma wrote: > > src/common/parse.hpp, lines 150-152 > > <https://reviews.apache.org/r/49352/diff/1/?file=1432428#file1432428line150> > > > > Call `insert` directly should be fine. `set` will help to avoid > > duplicated item. > > Guangya Liu wrote: > Here I need to return error if there are diplicate items, seems I cannot > use `set` for this as `set` do not have a method like `contain` which can > enable me to check the duplicate items, comments?
Return value of set: The single element versions (1) return a pair, with its member pair::first set to an iterator pointing to either the newly inserted element or to the equivalent element already in the set. **The pair::second element in the pair is set to true if a new element was inserted or false if an equivalent element already existed.** http://www.cplusplus.com/reference/set/set/insert/ - Klaus ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/49352/#review140009 ----------------------------------------------------------- On June 29, 2016, 8:12 p.m., Guangya Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/49352/ > ----------------------------------------------------------- > > (Updated June 29, 2016, 8:12 p.m.) > > > Review request for mesos and Benjamin Mahler. > > > Bugs: MESOS-5743 > https://issues.apache.org/jira/browse/MESOS-5743 > > > Repository: mesos > > > Description > ------- > > Added a flag parser for hashset<std::string>. > > > Diffs > ----- > > src/common/parse.hpp 19e56dbeb765f8bec92e0a3615f6f7c12466fa9e > > Diff: https://reviews.apache.org/r/49352/diff/ > > > Testing > ------- > > make > make check > > > Thanks, > > Guangya Liu > >
