Re: [Boost-bugs] [Boost C++ Libraries] #9574: flat_set(rand_iter, rand_iter) should use reserve()

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9574: flat_set(rand_iter, rand_iter) should use reserve()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-01-15 14:39:15


#9574: flat_set(rand_iter,rand_iter) should use reserve()
-------------------------------+------------------------
  Reporter: marc.glisse@… | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: container
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+------------------------

Comment (by marc.glisse@…):

 Ah, indeed you are right. In my case, I know the elements are unique. I
 guess it makes sense that I am responsible for using this extra
 information and I should write:
 {{{
 S s;
 s.reserve(v.size());
 s.insert(v.begin(),v.end());
 }}}
 Using a flat_multiset instead of a flat_set for speed reasons would be
 weird.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9574#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC