diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 19:40:39 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 19:40:39 +0000 |
| commit | b23fdac1bed6b8eedb8615526bfe75e16f70488a (patch) | |
| tree | efdfd86136a070108ac69fda382332c5475473a6 /libstdc++-v3/include/debug/unordered_set | |
| parent | 08cc44e74d28ab49958b246b6d1f3ee827c21d24 (diff) | |
| download | ppe42-gcc-b23fdac1bed6b8eedb8615526bfe75e16f70488a.tar.gz ppe42-gcc-b23fdac1bed6b8eedb8615526bfe75e16f70488a.zip | |
Add initializer_list support as per N2679.
* include/debug/unordered_map: Add initializer_list support.
* include/debug/safe_association.h: Likewise.
* include/debug/unordered_set: Likewise.
* include/debug/vector: Likewise.
* include/debug/deque: Likewise.
* include/debug/map.h: Likewise.
* include/debug/set.h: Likewise.
* include/debug/string: Likewise.
* include/debug/list: Likewise.
* include/debug/multimap.h: Likewise.
* include/tr1_impl/unordered_map: Likewise.
* include/tr1_impl/hashtable: Likewise.
* include/tr1_impl/unordered_set: Likewise.
* include/tr1_impl/regex: Likewise.
* include/std/valarray: Likewise.
* include/std/unordered_map: Likewise.
* include/std/unordered_set: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/basic_string.h: Likewise.
* include/bits/basic_string.tcc: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_bvector.h: Likewise.
* include/ext/vstring.h: Likewise.
* include/ext/rc_string_base.h: Likewise.
* include/ext/sso_string_base.h: Likewise.
* src/Makefile.am (w?string-inst): Build with -std=gnu++0x.
* src/Makefile.in: Likewise.
* config/abi/pre/gnu.ver: Add new w?string exports.
...
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138043 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug/unordered_set')
| -rw-r--r-- | libstdc++-v3/include/debug/unordered_set | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index b4b9be8a140..4c5d4d5ce34 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -41,6 +41,7 @@ # include <c++0x_warning.h> #endif +#include <initializer_list> #include <debug/safe_association.h> #include <debug/safe_iterator.h> @@ -65,6 +66,7 @@ namespace __debug public: typedef typename _Safe_assoc::size_type size_type; + typedef typename _Safe_assoc::value_type value_type; typedef typename _Safe_assoc::hasher hasher; typedef typename _Safe_assoc::key_equal key_equal; typedef typename _Safe_assoc::allocator_type allocator_type; @@ -86,6 +88,13 @@ namespace __debug : _Safe_assoc(__f, __l, __n, __hf, __eql, __a) { } + unordered_set(initializer_list<value_type> __l, + size_type __n = 10, + const hasher& __hf = hasher(), + const key_equal& __eql = key_equal(), + const allocator_type& __a = allocator_type()) + : _Safe_assoc(__l, __n, __hf, __eql, __a) { } + unordered_set(const _Safe_assoc& __x) : _Safe_assoc(__x), _Safe_base() { } @@ -101,6 +110,14 @@ namespace __debug return *this; } + unordered_set& + operator=(initializer_list<value_type> __l) + { + this->clear(); + this->insert(__l); + return *this; + } + void swap(unordered_set&& __x) { @@ -162,6 +179,7 @@ namespace __debug public: typedef typename _Safe_assoc::size_type size_type; + typedef typename _Safe_assoc::value_type value_type; typedef typename _Safe_assoc::hasher hasher; typedef typename _Safe_assoc::key_equal key_equal; typedef typename _Safe_assoc::allocator_type allocator_type; @@ -183,6 +201,13 @@ namespace __debug : _Safe_assoc(__f, __l, __n, __hf, __eql, __a) { } + unordered_multiset(initializer_list<value_type> __l, + size_type __n = 10, + const hasher& __hf = hasher(), + const key_equal& __eql = key_equal(), + const allocator_type& __a = allocator_type()) + : _Safe_assoc(__l, __n, __hf, __eql, __a) { } + unordered_multiset(const _Safe_assoc& __x) : _Safe_assoc(__x), _Safe_base() { } @@ -198,6 +223,14 @@ namespace __debug return *this; } + unordered_multiset& + operator=(initializer_list<value_type> __l) + { + this->clear(); + this->insert(__l); + return *this; + } + void swap(unordered_multiset&& __x) { |

