forked from boostorg/unordered
Merge latest hash and unordered developments, and add support for initialiser
lists to config. Merged revisions 49338,49924-49927,49955,50029,50118 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r49338 | danieljames | 2008-10-15 10:44:41 +0100 (Wed, 15 Oct 2008) | 2 lines Revert [49229], it fixes the same problem as [48674]. ........ r49924 | danieljames | 2008-11-24 22:55:14 +0000 (Mon, 24 Nov 2008) | 1 line Extra tests for equality with different hash functions. ........ r49925 | danieljames | 2008-11-24 22:55:47 +0000 (Mon, 24 Nov 2008) | 1 line Document operator==/operator!= as undefined if the equality predicates aren't equivalent. ........ r49926 | danieljames | 2008-11-24 22:56:04 +0000 (Mon, 24 Nov 2008) | 1 line Use a larger prime number list. ........ r49927 | danieljames | 2008-11-24 23:15:55 +0000 (Mon, 24 Nov 2008) | 1 line Use aligned storage for the value. ........ r49955 | danieljames | 2008-11-27 11:42:13 +0000 (Thu, 27 Nov 2008) | 1 line Wild stab at getting destruction working on more compilers. ........ r50029 | danieljames | 2008-11-29 21:47:55 +0000 (Sat, 29 Nov 2008) | 1 line Workaround another in-place destruction. ........ r50118 | danieljames | 2008-12-04 21:30:19 +0000 (Thu, 04 Dec 2008) | 1 line Add support for initializer lists to config and the unordered containers. ........ [SVN r50451]
This commit is contained in:
@@ -135,6 +135,24 @@ namespace boost
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_INITIALIZER_LISTS)
|
||||
unordered_map(std::initializer_list<value_type> list,
|
||||
size_type n = boost::unordered_detail::default_initial_bucket_count,
|
||||
const hasher &hf = hasher(),
|
||||
const key_equal &eql = key_equal(),
|
||||
const allocator_type &a = allocator_type())
|
||||
: base(list.begin(), list.end(), n, hf, eql, a)
|
||||
{
|
||||
}
|
||||
|
||||
unordered_map& operator=(std::initializer_list<value_type> list)
|
||||
{
|
||||
base.data_.clear();
|
||||
base.insert_range(list.begin(), list.end());
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
|
||||
@@ -523,6 +541,24 @@ namespace boost
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_INITIALIZER_LISTS)
|
||||
unordered_multimap(std::initializer_list<value_type> list,
|
||||
size_type n = boost::unordered_detail::default_initial_bucket_count,
|
||||
const hasher &hf = hasher(),
|
||||
const key_equal &eql = key_equal(),
|
||||
const allocator_type &a = allocator_type())
|
||||
: base(list.begin(), list.end(), n, hf, eql, a)
|
||||
{
|
||||
}
|
||||
|
||||
unordered_multimap& operator=(std::initializer_list<value_type> list)
|
||||
{
|
||||
base.data_.clear();
|
||||
base.insert_range(list.begin(), list.end());
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user