Subject: [Boost-bugs] [Boost C++ Libraries] #11993: Add a default constructor to intrusive unordered_set and unordered_multiset
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-17 03:27:13
#11993: Add a default constructor to intrusive unordered_set and unordered_multiset
------------------------------+------------------------
Reporter: anonymous | Owner: igaztanaga
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: intrusive
Version: Boost 1.60.0 | Severity: Problem
Keywords: |
------------------------------+------------------------
All the constructors of intrusive `unordered_set` and `unordered_multiset`
require a `bucket_traits`. It is currently not possible to instantiate an
`unordered_set` without having allocated some buckets.
It would be useful to add a default constructor to `unordered_set` and
`unordered_multiset`. That would allow to create hash containers that
allocate buckets lazily at the first element insertion.
That would also allow this kind of pattern:
{{{#!c++
unordered_set<MyType, ...> v;
if (some_condition) {
v = some_collection();
} else {
v = some_other_collection();
}
}}}
Bonus if the const methods of a default-constructed
unordered_set/unordered_multiset can be called and behave as an empty
collection (in particular `empty`, `size`, `begin`/`cbegin`, `end`/`cend`,
`count`, `find` and `equal_range`).
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11993> 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:19 UTC