Add support for initializer lists to config and the unordered containers.

[SVN r50118]
This commit is contained in:
Daniel James
2008-12-04 21:30:19 +00:00
parent c1e9a6ac59
commit fe3873b28f
5 changed files with 101 additions and 0 deletions

View File

@@ -133,6 +133,24 @@ namespace boost
#endif
#endif
#if !defined(BOOST_NO_INITIALIZER_LISTS)
unordered_set(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_set& 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&
@@ -493,6 +511,24 @@ namespace boost
#endif
#endif
#if !defined(BOOST_NO_INITIALIZER_LISTS)
unordered_multiset(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_multiset& 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&