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:16:27


#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 igaztanaga):

 The problem with "flat_set" and "flat_map" is that there is no way to know
 how many duplicates the input has. So "std::distance(first, last)" is the
 upper bound to be inserted but that could provoke a big memory waste.
 Would this be acceptable?. "flat_multiset" and "flat_multimap" dont't
 suffer from this problem so reservation should be done at least for these
 two.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9574#comment:1>
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