* 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.
...
From-SVN: r138043
+2008-07-21 Jason Merrill <jason@redhat.com>
+
+ 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.
+ * testsuite/21_strings/basic_string/init-list.cc: New test.
+ * testsuite/23_containers/vector/init-list.cc: New test.
+ * testsuite/23_containers/deque/init-list.cc: New test.
+ * testsuite/23_containers/list/init-list.cc: New test.
+ * testsuite/23_containers/map/init-list.cc: New test.
+ * testsuite/23_containers/multimap/init-list.cc: New test.
+ * testsuite/23_containers/set/init-list.cc: New test.
+ * testsuite/23_containers/multiset/init-list.cc: New test.
+ * testsuite/23_containers/unordered_map/init-list.cc: New test.
+ * testsuite/23_containers/unordered_multimap/init-list.cc: New test.
+ * testsuite/23_containers/unordered_set/init-list.cc: New test.
+ * testsuite/23_containers/unordered_multiset/init-list.cc: New test.
+ * testsuite/26_numerics/valarray/init-list.cc: New test.
+ * testsuite/28_regex/init-list.cc: New test.
+ * testsuite/ext/vstring/init-list.cc: New test.
+ * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
+ Update error lineno.
+ * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
+ Update error lineno.
+
2008-07-21 Mark Mitchell <mark@codesourcery.com>
* config/os/gnu-linux/arm-eabi-extra.ver: New file.
# Names not in an 'extern' block are mangled names.
# std::string
- _ZNSsC*;
+ _ZNSsC[12][EI][PRjmvN]*;
_ZNSsD*;
- _ZNSs[0-9][a-z]*;
+ _ZNSs[0-58-9][a-z]*;
+ _ZNSs[67][a-z]*E[PRcjmv]*;
+ _ZNSs7[a-z]*EES2_[NPRjm]*;
+ _ZNSs7[a-z]*EES2_S[12]*;
_ZNSs12_Alloc_hiderC*;
_ZNSs12_M_leak_hardEv;
_ZNSs12_S_constructE[jm]cRKSaIcE;
_ZNSs4_Rep20_S_empty_rep_storageE;
_ZNSs4_Rep11_S_max_sizeE;
_ZNSs4_Rep11_S_terminalE;
- _ZNSsaSE*;
+ _ZNSsaSE[PRc]*;
_ZNSsixE*;
- _ZNSspLE*;
+ _ZNSspLE[PRc]*;
_ZNKSs[0-9][a-z]*;
_ZNKSs[0-9][0-9][a-z]*;
_ZNKSs[a-z]*;
_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_E*;
# std::wstring
- _ZNSbIwSt11char_traitsIwESaIwEEC*;
+ _ZNSbIwSt11char_traitsIwESaIwEEC[12][EI][PRjmvN]*;
_ZNSbIwSt11char_traitsIwESaIwEED*;
- _ZNSbIwSt11char_traitsIwESaIwEE[0-9][a-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][a-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[67][a-z]*E[PRwjmv]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_[NPRjm]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE7[a-z]*EES6_S[56]*;
_ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC*;
_ZNSbIwSt11char_traitsIwESaIwEE12_M_leak_hardEv;
_ZNSbIwSt11char_traitsIwESaIwEE12_S_constructE[jm]wRKS1_;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep11_S_max_sizeE;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep11_S_terminalE;
- _ZNSbIwSt11char_traitsIwESaIwEEaSE*;
+ _ZNSbIwSt11char_traitsIwESaIwEEaSE[PRw]*;
_ZNSbIwSt11char_traitsIwESaIwEEixE*;
- _ZNSbIwSt11char_traitsIwESaIwEEpLE*;
+ _ZNSbIwSt11char_traitsIwESaIwEEpLE[PRw]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[0-9][a-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[0-9][0-9][a-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[a-z]*;
_ZNSt6chrono12system_clock12is_monotonicE;
_ZNSt6chrono12system_clock3nowEv;
+ # string/wstring initializer_list overloads
+ _ZNSs6appendESt16initializer_listIcE;
+ _ZNSs6assignESt16initializer_listIcE;
+ _ZNSs6insertEN9__gnu_cxx17__normal_iteratorIPcSsEESt16initializer_listIcE;
+ _ZNSs7replaceEN9__gnu_cxx17__normal_iteratorIPcSsEES2_St16initializer_listIcE;
+ _ZNSsC1ESt16initializer_listIcERKSaIcE;
+ _ZNSsC2ESt16initializer_listIcERKSaIcE;
+ _ZNSsaSESt16initializer_listIcE;
+ _ZNSspLESt16initializer_listIcE;
+ _ZNSbIwSt11char_traitsIwESaIwEE6appendESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEE6assignESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEE6insertEN9__gnu_cxx17__normal_iteratorIPwS2_EESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEE7replaceEN9__gnu_cxx17__normal_iteratorIPwS2_EES6_St16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEEC1ESt16initializer_listIwERKS1_;
+ _ZNSbIwSt11char_traitsIwESaIwEEC2ESt16initializer_listIwERKS1_;
+ _ZNSbIwSt11char_traitsIwESaIwEEaSESt16initializer_listIwE;
+ _ZNSbIwSt11char_traitsIwESaIwEEpLESt16initializer_listIwE;
+
} GLIBCXX_3.4.10;
# Symbols in the support library (libsupc++) have their own tag.
#include <ext/atomicity.h>
#include <debug/debug.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NAMESPACE(std)
*/
basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Construct string from an initializer list.
+ * @param l std::initializer_list of characters.
+ * @param a Allocator to use (default is default allocator).
+ */
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Construct string as copy of a range.
* @param beg Start of range.
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param l std::initializer_list.
+ */
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
// Iterators:
/**
* Returns a read/write iterator that points to the first character in
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a string to this string.
* @param str The string to append.
basic_string&
append(size_type __n, _CharT __c);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ basic_string&
+ append(initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a range of characters.
* @param first Iterator referencing the first character to append.
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert multiple characters.
* @param p Iterator referencing location in string to insert at.
insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert value of a string.
* @param pos1 Iterator referencing location in string to insert at.
__k1.base(), __k2 - __k1);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
private:
template<class _Integer>
basic_string&
: _M_dataplus(_S_construct(__beg, __end, __a), __a)
{ }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>::
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__l.begin(), __l.end(), __a), __a)
+ { }
+#endif
+
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
#ifndef _STL_BVECTOR_H
#define _STL_BVECTOR_H 1
+#include <initializer_list>
+
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
typedef unsigned long _Bit_type;
#ifdef __GXX_EXPERIMENTAL_CXX0X__
vector(vector&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ vector(initializer_list<bool> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_initialize_range(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
#endif
template<typename _InputIterator>
this->swap(__x);
return *this;
}
+
+ vector&
+ operator=(initializer_list<bool> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
#endif
// assign(), a generalized assignment member function. Two
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<bool> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
iterator
begin()
{ return this->_M_impl._M_start; }
insert(iterator __position, size_type __n, const bool& __x)
{ _M_fill_insert(__position, __n, __x); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void insert(iterator __p, initializer_list<bool> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif
+
void
pop_back()
{ --this->_M_impl._M_finish; }
#include <bits/concept_check.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
deque(deque&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %deque from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator object.
+ *
+ * Create a %deque consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is l.size()) and do no memory reallocation.
+ */
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
#endif
/**
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %deque.
+ * @param l An initializer_list.
+ *
+ * This function fills a %deque with copies of the elements in the
+ * initializer_list @a l.
+ *
+ * Note that the assignment completely changes the %deque and that the
+ * resulting %deque's size is the same as the number of elements
+ * assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const
iterator
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer list into the %deque.
+ * @param p An iterator into the %deque.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %deque before the location
+ * specified by @a p. This is known as "list insert."
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
#endif
/**
#define _STL_LIST_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
list(list&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %list from an initializer_list
+ * @param l An initializer_list of value_type.
+ * @param a An allocator object.
+ *
+ * Create a %list consisting of copies of the elements in the
+ * initializer_list @a l. This is linear in l.size().
+ */
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
#endif
/**
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %List initializer list assignment operator.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer_list to a %list.
+ * @param l An initializer_list of value_type.
+ *
+ * Replace the contents of the %list with copies of the elements
+ * in the initializer_list @a l. This is linear in l.size().
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const
iterator
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts the contents of an initializer_list into %list
+ * before specified iterator.
+ * @param p An iterator into the %list.
+ * @param l An initializer_list of value_type.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %list before the location
+ * specified by @a p.
+ *
+ * This operation is linear in the number of elements inserted and
+ * does not invalidate iterators and references.
+ */
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
#endif
/**
*/
map(map&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %map from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison object.
+ * @param a An allocator object.
+ *
+ * Create a %map consisting of copies of the elements in the
+ * initializer_list @a l.
+ * This is linear in N if the range is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__c, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
/**
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Map list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %map with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %map and
+ * that the resulting %map's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/// Get a copy of the memory allocation object.
* inserted.
*
* Complexity similar to that of the range constructor.
- *
*/
void
insert(std::initializer_list<value_type> __list)
#define _STL_MULTIMAP_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
multimap(multimap&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multimap from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multimap consisting of copies of the elements from
+ * the initializer_list. This is linear in N if the list is already
+ * sorted, and NlogN otherwise (where N is @a __l.size()).
+ */
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
#endif
/**
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Multimap list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multimap with copies of the elements
+ * in the initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multimap and
+ * that the resulting %multimap's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/// Get a copy of the memory allocation object.
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_equal(__first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of std::pairs into the %multimap.
+ * @param list A std::initializer_list<value_type> of pairs to be
+ * inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
/**
* @brief Erases an element from a %multimap.
* @param position An iterator pointing to the element to be erased.
#define _STL_MULTISET_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
multiset(multiset&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %multiset from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %multiset consisting of copies of the elements from
+ * the list. This is linear in N if the list is already sorted,
+ * and NlogN otherwise (where N is @a l.size()).
+ */
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_equal(__l.begin(), __l.end()); }
#endif
/**
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Multiset list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %multiset with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %multiset and
+ * that the resulting %multiset's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
// accessors:
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_equal(__first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %multiset.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
/**
* @brief Erases an element from a %multiset.
* @param position An iterator pointing to the element to be erased.
#define _STL_SET_H 1
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
set(set&& __x)
: _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+
+ /**
+ * @brief Builds a %set from an initializer_list.
+ * @param l An initializer_list.
+ * @param comp A comparison functor.
+ * @param a An allocator object.
+ *
+ * Create a %set consisting of copies of the elements in the list.
+ * This is linear in N if the list is already sorted, and NlogN
+ * otherwise (where N is @a l.size()).
+ */
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
+ { _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
/**
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Set list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %set with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %set and
+ * that the resulting %set's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
// accessors:
insert(_InputIterator __first, _InputIterator __last)
{ _M_t._M_insert_unique(__first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Attempts to insert a list of elements into the %set.
+ * @param list A std::initializer_list<value_type> of elements
+ * to be inserted.
+ *
+ * Complexity similar to that of the range constructor.
+ */
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
/**
* @brief Erases an element from a %set.
* @param position An iterator pointing to the element to be erased.
#include <bits/stl_iterator_base_funcs.h>
#include <bits/functexcept.h>
#include <bits/concept_check.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
vector(vector&& __x)
: _Base(std::forward<_Base>(__x)) { }
+
+ /**
+ * @brief Builds a %vector from an initializer list.
+ * @param l An initializer_list.
+ * @param a An allocator.
+ *
+ * Create a %vector consisting of copies of the elements in the
+ * initializer_list @a l.
+ *
+ * This will call the element type's copy constructor N times
+ * (where N is @a l.size()) and do no memory reallocation.
+ */
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
#endif
/**
this->swap(__x);
return *this;
}
+
+ /**
+ * @brief %Vector list assignment operator.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
_M_assign_dispatch(__first, __last, _Integral());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assigns an initializer list to a %vector.
+ * @param l An initializer_list.
+ *
+ * This function fills a %vector with copies of the elements in the
+ * initializer list @a l.
+ *
+ * Note that the assignment completely changes the %vector and
+ * that the resulting %vector's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ void
+ assign(initializer_list<value_type> __l)
+ { this->assign(__l.begin(), __l.end()); }
+#endif
+
/// Get a copy of the memory allocation object.
using _Base::get_allocator;
iterator
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ /**
+ * @brief Inserts an initializer_list into the %vector.
+ * @param position An iterator into the %vector.
+ * @param l An initializer_list.
+ *
+ * This function will insert copies of the data in the
+ * initializer_list @a l into the %vector before the location
+ * specified by @a position.
+ *
+ * Note that this kind of operation could be expensive for a
+ * %vector and if it is frequently used the user should
+ * consider using std::list.
+ */
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
#endif
/**
deque(deque&& __x)
: _Base(std::forward<deque>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ deque(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
#endif
~deque() { }
swap(__x);
return *this;
}
+
+ deque&
+ operator=(initializer_list<value_type> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
#endif
template<class _InputIterator>
this->_M_invalidate_all();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
+#endif
+
using _Base::get_allocator;
// iterators:
iterator
insert(iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
#endif
void
list(list&& __x)
: _Base(std::forward<list>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ list(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base() { }
#endif
~list() { }
swap(__x);
return *this;
}
+
+ list&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ }
#endif
template<class _InputIterator>
iterator
insert(iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __p, initializer_list<value_type> __l)
+ {
+ __glibcxx_check_insert(__p);
+ _Base::insert(__p, __l);
+ }
#endif
void
map(map&& __x)
: _Base(std::forward<map>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ map(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
#endif
~map() { }
swap(__x);
return *this;
}
+
+ map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
__res.second);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
iterator
insert(iterator __position, const value_type& __x)
{
multimap(multimap&& __x)
: _Base(std::forward<multimap>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ multimap(initializer_list<value_type> __l,
+ const _Compare& __c = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __c, __a), _Safe_base() { }
#endif
~multimap() { }
swap(__x);
return *this;
}
+
+ multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
using _Base::get_allocator;
insert(const value_type& __x)
{ return iterator(_Base::insert(__x), this); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(std::initializer_list<value_type> __list)
+ { _Base::insert(__list); }
+#endif
+
iterator
insert(iterator __position, const value_type& __x)
{
multiset(multiset&& __x)
: _Base(std::forward<multiset>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ multiset(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
#endif
~multiset() { }
swap(__x);
return *this;
}
+
+ multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
using _Base::get_allocator;
_Base::insert(__first, __last);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
void
erase(iterator __position)
{
__l, __n, __hf, __eql, __a)
{ }
+ _Safe_association(std::initializer_list<value_type> __l,
+ size_type __n,
+ const hasher& __hf,
+ const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __n, __hf, __eql, __a)
+ { }
+
_Safe_association(const _Base& __x) : _Base(__x) { }
_Safe_association(_Safe_association&& __x)
_Base::insert(__first.base(), __last.base());
}
+ void
+ insert(std::initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+
const_iterator
find(const key_type& __key) const
{ return const_iterator(_Base::find(__key), this); }
set(set&& __x)
: _Base(std::forward<set>(__x)), _Safe_base()
{ this->_M_swap(__x); }
+
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __comp, __a), _Safe_base() { }
#endif
~set() { }
swap(__x);
return *this;
}
+
+ set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
#endif
using _Base::get_allocator;
_Base::insert(__first, __last);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(initializer_list<value_type> __l)
+ { _Base::insert(__l); }
+#endif
+
void
erase(iterator __position)
{
: _Base(__gnu_debug::__check_valid_range(__begin, __end), __end, __a)
{ }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+ : _Base(__l, __a)
+ { }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
~basic_string() { }
basic_string&
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator=(initializer_list<_CharT> __l)
+ {
+ *static_cast<_Base*>(this) = __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
// 21.3.2 iterators:
iterator
begin()
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ operator+=(initializer_list<_CharT> __l)
+ {
+ _M_base() += __l;
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
basic_string&
append(const basic_string& __str)
{
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string&
+ assign(initializer_list<_CharT> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
basic_string&
insert(size_type __pos1, const basic_string& __str)
{
this->_M_invalidate_all();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ insert(iterator __p, initializer_list<_CharT> __l)
+ {
+ _Base::insert(__p, __l);
+ this->_M_invalidate_all();
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
basic_string&
erase(size_type __pos = 0, size_type __n = _Base::npos)
{
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __l);
+ this->_M_invalidate_all();
+ return *this;
+ }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
size_type
copy(_CharT* __s, size_type __n, size_type __pos = 0) const
{
#else
# include <c++0x_warning.h>
#endif
+#include <initializer_list>
#include <debug/safe_association.h>
#include <debug/safe_iterator.h>
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;
unordered_map(unordered_map&& __x)
: _Safe_assoc(std::forward<_Safe_assoc>(__x)), _Safe_base() { }
+ unordered_map(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_map&
operator=(unordered_map&& __x)
{
return *this;
}
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_map&& __x)
{
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;
: _Safe_assoc(__f, __l, __n, __hf, __eql, __a)
{ }
+ unordered_multimap(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_multimap(const _Safe_assoc& __x)
: _Safe_assoc(__x), _Safe_base() { }
return *this;
}
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_multimap&& __x)
{
# include <c++0x_warning.h>
#endif
+#include <initializer_list>
#include <debug/safe_association.h>
#include <debug/safe_iterator.h>
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;
: _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() { }
return *this;
}
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_set&& __x)
{
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;
: _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() { }
return *this;
}
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l);
+ return *this;
+ }
+
void
swap(unordered_multiset&& __x)
{
this->_M_swap(__x);
__x._M_guaranteed_capacity = 0;
}
+
+ vector(initializer_list<value_type> __l,
+ const allocator_type& __a = allocator_type())
+ : _Base(__l, __a), _Safe_base(),
+ _M_guaranteed_capacity(__l.size()) { }
#endif
~vector() { }
swap(__x);
return *this;
}
+
+ vector&
+ operator=(initializer_list<value_type> __l)
+ {
+ static_cast<_Base&>(*this) = __l;
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ return *this;
+ }
#endif
template<typename _InputIterator>
_M_update_guaranteed_capacity();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ assign(initializer_list<value_type> __l)
+ {
+ _Base::assign(__l);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+#endif
+
using _Base::get_allocator;
// iterators:
iterator>::__type
insert(iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
+
+ void
+ insert(iterator __position, initializer_list<value_type> __l)
+ { this->insert(__position, __l.begin(), __l.end()); }
#endif
void
#ifdef __GXX_EXPERIMENTAL_CXX0X__
__rc_string_base(__rc_string_base&& __rcs)
: _M_dataplus(__rcs._M_get_allocator(), __rcs._M_data())
- { __rcs._M_data(_S_empty_rep._M_refcopy()); }
+ { __rcs._M_data(_S_empty_rep._M_refcopy()); }
+
+ __rc_string_base(std::initializer_list<_CharT> __l, const _Alloc& __a)
+ : _M_dataplus(__a, _S_construct(__l.begin(), __l.end(), __a)) { }
#endif
__rc_string_base(size_type __n, _CharT __c, const _Alloc& __a);
#ifdef __GXX_EXPERIMENTAL_CXX0X__
__sso_string_base(__sso_string_base&& __rcs);
+
+ __sso_string_base(std::initializer_list<_CharT> __l, const _Alloc& __a)
+ : _M_dataplus(__a, _M_local_data)
+ { _M_construct(__l.begin(), __l.end()); }
#endif
__sso_string_base(size_type __n, _CharT __c, const _Alloc& __a);
#pragma GCC system_header
+#include <initializer_list>
#include <ext/vstring_util.h>
#include <ext/rc_string_base.h>
#include <ext/sso_string_base.h>
*/
__versa_string(__versa_string&& __str)
: __vstring_base(std::forward<__vstring_base>(__str)) { }
+
+ /**
+ * @brief Construct string from an initializer list.
+ * @param l std::initializer_list of characters.
+ * @param a Allocator to use (default is default allocator).
+ */
+ __versa_string(std::initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+ : __vstring_base(__l, __a) { }
#endif
/**
this->swap(__str);
return *this;
}
+
+ /**
+ * @brief Set value to string constructed from initializer list.
+ * @param l std::initializer_list.
+ */
+ __versa_string&
+ operator=(std::initializer_list<_CharT> __l)
+ {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+ }
#endif
/**
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to be appended.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ operator+=(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a string to this string.
* @param str The string to append.
append(size_type __n, _CharT __c)
{ return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Append an initializer_list of characters.
+ * @param l The initializer_list of characters to append.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ append(std::initializer_list<_CharT> __l)
+ { return this->append(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Append a range of characters.
* @param first Iterator referencing the first character to append.
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Set value to an initializer_list of characters.
+ * @param l The initializer_list of characters to assign.
+ * @return Reference to this string.
+ */
+ __versa_string&
+ assign(std::initializer_list<_CharT> __l)
+ { return this->assign(__l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert multiple characters.
* @param p Iterator referencing location in string to insert at.
insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Insert an initializer_list of characters.
+ * @param p Iterator referencing location in string to insert at.
+ * @param l The initializer_list of characters to insert.
+ * @throw std::length_error If new length exceeds @c max_size().
+ */
+ void
+ insert(iterator __p, std::initializer_list<_CharT> __l)
+ { this->insert(__p, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
/**
* @brief Insert value of a string.
* @param pos1 Iterator referencing location in string to insert at.
__k1.base(), __k2 - __k1);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Replace range of characters with initializer_list.
+ * @param i1 Iterator referencing start of range to replace.
+ * @param i2 Iterator referencing end of range to replace.
+ * @param l The initializer_list of characters to insert.
+ * @return Reference to this string.
+ * @throw std::length_error If new length exceeds @c max_size().
+ *
+ * Removes the characters in the range [i1,i2). In place, characters
+ * in the range [k1,k2) are inserted. If the length of result exceeds
+ * max_size(), length_error is thrown. The value of the string doesn't
+ * change if an error is thrown.
+ */
+ __versa_string& replace(iterator __i1, iterator __i2,
+ std::initializer_list<_CharT> __l)
+ { return this->replace(__i1, __i2, __l.begin(), __l.end()); }
+#endif // __GXX_EXPERIMENTAL_CXX0X__
+
private:
template<class _Integer>
__versa_string&
#include <utility>
#include <type_traits>
+#include <initializer_list>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <utility>
#include <type_traits>
+#include <initializer_list>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <cmath>
#include <algorithm>
#include <debug/debug.h>
+#include <initializer_list>
_GLIBCXX_BEGIN_NAMESPACE(std)
/// Construct an array with the same size and values in @a ia.
valarray(const indirect_array<_Tp>&);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// Construct an array with an initializer_list of values.
+ valarray(initializer_list<_Tp>);
+#endif
+
template<class _Dom>
valarray(const _Expr<_Dom, _Tp>& __e);
*/
valarray<_Tp>& operator=(const indirect_array<_Tp>&);
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * @brief Assign elements to an initializer_list.
+ *
+ * Assign elements of array to values in @a l. Results are undefined
+ * if @a l does not have the same size as this array.
+ *
+ * @param l initializer_list to get values from.
+ */
+ valarray& operator=(initializer_list<_Tp>);
+#endif
+
template<class _Dom> valarray<_Tp>&
operator= (const _Expr<_Dom, _Tp>&);
(__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline
+ valarray<_Tp>::valarray(initializer_list<_Tp> __l)
+ : _M_size(__l.size()), _M_data(__valarray_get_storage<_Tp>(__l.size()))
+ { std::__valarray_copy_construct (__l.begin(), __l.end(), _M_data); }
+#endif
+
template<typename _Tp> template<class _Dom>
inline
valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp>
+ inline valarray<_Tp>&
+ valarray<_Tp>::operator=(initializer_list<_Tp> __l)
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __l.size());
+ std::__valarray_copy(__l.begin(), __l.size(), _M_data);
+ }
+#endif
+
template<typename _Tp>
inline valarray<_Tp>&
valarray<_Tp>::operator=(const _Tp& __t)
void
insert(_InputIterator __first, _InputIterator __last);
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ void
+ insert(initializer_list<value_type> __l)
+ { this->insert(__l.begin(), __l.end()); }
+#endif
+
iterator
erase(iterator);
: _M_flags(__f), _M_pattern(__first, __last), _M_mark_count(0)
{ _M_compile(); }
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ basic_regex(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ : _M_flags(__f), _M_pattern(__l.begin(), __l.end()), _M_mark_count(0)
+ { _M_compile(); }
+#endif
+
/**
* @brief Destroys a basic regular expression.
*/
flag_type __flags = regex_constants::ECMAScript)
{ return this->assign(string_type(__first, __last), __flags); }
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ basic_regex&
+ assign(initializer_list<_Ch_type> __l,
+ flag_type __f = regex_constants::ECMAScript)
+ { return this->assign(__l.begin(), __l.end(), __f); }
+#endif
+
// [7.8.4] const operations
/**
* @brief Gets the number of marked subexpressions within the regular
typedef __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
unordered_map(unordered_map&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ unordered_map(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())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_map&
operator=(unordered_map&& __x)
{
this->swap(__x);
return *this;
}
+
+ unordered_map&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
typedef __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
unordered_multimap(unordered_multimap&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ unordered_multimap(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())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_multimap&
operator=(unordered_multimap&& __x)
{
this->swap(__x);
return *this;
}
+
+ unordered_multimap&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
typedef __unordered_set<_Value, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
unordered_set(unordered_set&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ 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())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_set&
operator=(unordered_set&& __x)
{
this->swap(__x);
return *this;
}
+
+ unordered_set&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
typedef __unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base;
public:
+ typedef typename _Base::value_type value_type;
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
unordered_multiset(unordered_multiset&& __x)
: _Base(std::forward<_Base>(__x)) { }
+ 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())
+ : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a)
+ { }
+
unordered_multiset&
operator=(unordered_multiset&& __x)
{
this->swap(__x);
return *this;
}
+
+ unordered_multiset&
+ operator=(initializer_list<value_type> __l)
+ {
+ this->clear();
+ this->insert(__l.begin(), __l.end());
+ return *this;
+ }
#endif
};
atomic.o: atomic.cc
$(CXXCOMPILE) -x c++ -std=gnu++0x -c $<
+string-inst.lo: string-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+string-inst.o: string-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
+wstring-inst.lo: wstring-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+wstring-inst.o: wstring-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
chrono.lo: chrono.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
chrono.o: chrono.cc
atomic.o: atomic.cc
$(CXXCOMPILE) -x c++ -std=gnu++0x -c $<
+string-inst.lo: string-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+string-inst.o: string-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
+wstring-inst.lo: wstring-inst.cc
+ $(LTCXXCOMPILE) -std=gnu++0x -c $<
+wstring-inst.o: wstring-inst.cc
+ $(CXXCOMPILE) -std=gnu++0x -c $<
+
chrono.lo: chrono.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
chrono.o: chrono.cc
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <string>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01(void)
+{
+ bool test = true;
+
+ string s1 = { 'a', 'b', 'c' };
+ VERIFY(s1 == "abc");
+
+ s1 = { 'd', 'e', 'f' };
+ VERIFY(s1 == "def");
+
+ s1 += { 'g', 'h', 'i' };
+ VERIFY(s1 == "defghi");
+
+ s1.append({ 'j', 'k', 'l' });
+ VERIFY(s1 == "defghijkl");
+
+ s1.assign({ 'm', 'n', 'o' });
+ VERIFY(s1 == "mno");
+
+ // There aren't actually overloads of insert and replace taking size_type
+ // and initializer_list, but test the usage anyway.
+ s1.insert(2, { 'p', 'q', 'r' });
+ VERIFY(s1 == "mnpqro");
+
+ s1.replace(2, 3, { 's', 't', 'u' });
+ VERIFY(s1 == "mnstuo");
+
+ string::iterator i1, i2;
+
+ i1 = s1.begin()+2;
+ s1.insert(i1, { 'v', 'w', 'x' });
+ VERIFY(s1 == "mnvwxstuo");
+
+ i1 = s1.begin()+2;
+ i2 = i1+6;
+ s1.replace(i1, i2, { 'y', 'z' });
+ VERIFY(s1 == "mnyzo");
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+ return 0;
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <deque>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::deque<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c({ 2, 4, 1 });
+ ok = check_construct_destroy("Construct from init-list", 3, 0) && ok;
+ ok &= (c[0] == 2);
+ ok &= (c[1] == 4);
+ }
+ ok = check_construct_destroy("Construct from init-list", 3, 3) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin() + 7, { 234, 42, 1 });
+ ok = check_construct_destroy("Insert init-list", 3, 0) && ok;
+ ok &= (c[7] == 234);
+ }
+ ok = check_construct_destroy("Insert init-list", 3, 13) && ok;
+
+ {
+ Container c;
+ tracker_allocator_counter::reset();
+ c = { 13, 0, 42 };
+ ok = check_construct_destroy("Assign init-list", 3, 0) && ok;
+ ok &= (c[0] == 13);
+ }
+ ok = check_construct_destroy("Assign init-list", 3, 3) && ok;
+
+ return ok ? 0 : 1;;
+}
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1436 }
+// { dg-error "no matching" "" { target *-*-* } 1504 }
// { dg-excess-errors "" }
#include <deque>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1375 }
+// { dg-error "no matching" "" { target *-*-* } 1443 }
// { dg-excess-errors "" }
#include <deque>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1375 }
+// { dg-error "no matching" "" { target *-*-* } 1443 }
// { dg-excess-errors "" }
#include <deque>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1520 }
+// { dg-error "no matching" "" { target *-*-* } 1588 }
// { dg-excess-errors "" }
#include <deque>
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <list>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::list<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c({ 2, 4, 1 });
+ ok = check_construct_destroy("Construct from init-list", 3, 0) && ok;
+ Container::iterator i = c.begin();
+ ok &= (*i++ == 2);
+ ok &= (*i++ == 4);
+ }
+ ok = check_construct_destroy("Construct from init-list", 3, 3) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ tracker_allocator_counter::reset();
+ Container::iterator i = c.begin();
+ ++i; ++i; ++i; ++i; ++i; ++i; ++i;
+ c.insert(i, { 234, 42, 1 });
+ ok = check_construct_destroy("Insert init-list", 3, 0) && ok;
+ ok &= (*--i == 1);
+ ok &= (*--i == 42);
+ }
+ ok = check_construct_destroy("Insert init-list", 3, 13) && ok;
+
+ {
+ Container c;
+ tracker_allocator_counter::reset();
+ c = { 13, 0, 42 };
+ ok = check_construct_destroy("Assign init-list", 3, 0) && ok;
+ Container::iterator i = c.begin();
+ ok &= (*i++ == 13);
+ }
+ ok = check_construct_destroy("Assign init-list", 3, 3) && ok;
+
+ return ok ? 0 : 1;;
+}
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1325 }
+// { dg-error "no matching" "" { target *-*-* } 1383 }
// { dg-excess-errors "" }
#include <list>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1294 }
+// { dg-error "no matching" "" { target *-*-* } 1352 }
// { dg-excess-errors "" }
#include <list>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1294 }
+// { dg-error "no matching" "" { target *-*-* } 1352 }
// { dg-excess-errors "" }
#include <list>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1294 }
+// { dg-error "no matching" "" { target *-*-* } 1352 }
// { dg-excess-errors "" }
#include <list>
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ map<int,double> m({ { 1, 1.0 }, { 2, 2.0 }, { 42, 237.0 } });
+ VERIFY(m.size() == 3);
+ VERIFY(m[1] == 1.0);
+ VERIFY(m[2] == 2.0);
+ VERIFY(m[42] == 237.0);
+
+ m = { {5, 55.0}, { 6, 66.0 } };
+ VERIFY(m.size() == 2);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+
+ m.insert({ { 7, 77.0 }, { 8, 88.0 } });
+ VERIFY(m.size() == 4);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+ VERIFY(m[7] == 77.0);
+ VERIFY(m[8] == 88.0);
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef multimap<int,double> Container;
+ typedef Container::iterator iterator;
+ typedef pair<iterator,iterator> itpair;
+ Container m({ { 1, 1.0 }, { 1, 2.0 }, { 1, 237.0 } });
+ VERIFY(m.size() == 3);
+ itpair ip = m.equal_range(1);
+ VERIFY(distance(ip.first, ip.second) == 3);
+ iterator i = ip.first;
+ VERIFY((*i++).second == 1.0);
+ VERIFY((*i++).second == 2.0);
+ VERIFY((*i++).second == 237.0);
+
+ m = { {5, 55.0}, { 5, 66.0 }, { 42, 4242.0 } };
+ VERIFY(m.size() == 3);
+ ip = m.equal_range(5);
+ VERIFY(distance(ip.first, ip.second) == 2);
+ i = ip.first;
+ VERIFY((*i++).second == 55.0);
+ VERIFY((*i++).second == 66.0);
+
+ m.insert({ { 7, 77.0 }, { 7, 88.0 } });
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(7) == 2);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ multiset<int> m({ 1, 5, 5, 37 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 37, 37, 102 };
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42, 42 });
+ VERIFY(m.size() == 7);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 2);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ set<int> m({ 1, 5, 37 });
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 102 };
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ unordered_map<int,double> m({ { 1, 1.0 }, { 2, 2.0 }, { 42, 237.0 } });
+ VERIFY(m.size() == 3);
+ VERIFY(m[1] == 1.0);
+ VERIFY(m[2] == 2.0);
+ VERIFY(m[42] == 237.0);
+
+ m = { {5, 55.0}, { 6, 66.0 } };
+ VERIFY(m.size() == 2);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+
+ m.insert({ { 7, 77.0 }, { 8, 88.0 } });
+ VERIFY(m.size() == 4);
+ VERIFY(m[5] == 55.0);
+ VERIFY(m[6] == 66.0);
+ VERIFY(m[7] == 77.0);
+ VERIFY(m[8] == 88.0);
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+// XFAIL this test until debug mode container is fixed.
+// { dg-excess-errors "" }
+
+#include <set>
+#include <unordered_map>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef unordered_multimap<int,double> Container;
+ typedef Container::const_iterator iterator;
+ typedef pair<iterator,iterator> itpair;
+
+ Container m({ { 1, 1.0 }, { 1, 2.0 }, { 1, 237.0 } });
+ VERIFY(m.size() == 3);
+ itpair ip = m.equal_range(1);
+ VERIFY(distance(ip.first, ip.second) == 3);
+ set<double> s = { 1.0, 2.0, 237.0 };
+ for (iterator i = ip.first; i != ip.second; ++i)
+ s.erase (i->second);
+ VERIFY(s.empty());
+
+ m = { {5, 55.0}, { 5, 66.0 }, { 42, 4242.0 } };
+ VERIFY(m.size() == 3);
+ ip = m.equal_range(5);
+ VERIFY(distance(ip.first, ip.second) == 2);
+ s = { 55.0, 66.0 };
+ for (iterator i = ip.first; i != ip.second; ++i)
+ s.erase (i->second);
+ VERIFY(s.empty());
+
+ m.insert({ { 7, 77.0 }, { 7, 88.0 } });
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(7) == 2);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ unordered_multiset<int> m({ 1, 5, 5, 37 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 2);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 37, 37, 102 };
+ VERIFY(m.size() == 5);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42, 42 });
+ VERIFY(m.size() == 7);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 3);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 2);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ unordered_set<int> m({ 1, 5, 37 });
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(1) == 1);
+ VERIFY(m.count(5) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(42) == 0);
+
+ m = { 28, 37, 102 };
+ VERIFY(m.size() == 3);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(1) == 0);
+
+ m.insert({ 42 });
+ VERIFY(m.size() == 4);
+ VERIFY(m.count(28) == 1);
+ VERIFY(m.count(37) == 1);
+ VERIFY(m.count(102) == 1);
+ VERIFY(m.count(42) == 1);
+ VERIFY(m.count(1) == 0);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::vector<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c({ 2, 4, 1 });
+ ok = check_construct_destroy("Construct from init-list", 3, 0) && ok;
+ ok &= (c[0] == 2);
+ ok &= (c[1] == 4);
+ }
+ ok = check_construct_destroy("Construct from init-list", 3, 3) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin() + 7, { 234, 42, 1 });
+ ok = check_construct_destroy("Insert init-list", 13, 10) && ok;
+ ok &= (c[7] == 234);
+ }
+ ok = check_construct_destroy("Insert init-list", 13, 23) && ok;
+
+ {
+ Container c;
+ tracker_allocator_counter::reset();
+ c = { 13, 0, 42 };
+ ok = check_construct_destroy("Assign init-list", 3, 0) && ok;
+ ok &= (c[0] == 13);
+ }
+ ok = check_construct_destroy("Assign init-list", 3, 3) && ok;
+
+ return ok ? 0 : 1;;
+}
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 986 }
+// { dg-error "no matching" "" { target *-*-* } 1058 }
// { dg-excess-errors "" }
#include <vector>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 926 }
+// { dg-error "no matching" "" { target *-*-* } 998 }
// { dg-excess-errors "" }
#include <vector>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 926 }
+// { dg-error "no matching" "" { target *-*-* } 998 }
// { dg-excess-errors "" }
#include <vector>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1027 }
+// { dg-error "no matching" "" { target *-*-* } 1099 }
// { dg-excess-errors "" }
#include <vector>
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <valarray>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ valarray<int> m({ 1, 5, 37 });
+ VERIFY(m.size() == 3);
+ VERIFY(m[0] == 1);
+ VERIFY(m[1] == 5);
+ VERIFY(m[2] == 37);
+
+ m = { 28, 37, 102 };
+ VERIFY(m.size() == 3);
+ VERIFY(m[0] == 28);
+ VERIFY(m[1] == 37);
+ VERIFY(m[2] == 102);
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+int test01(void)
+{
+ bool test = true;
+
+ regex r = { 'a', 'b', 'c' };
+ cmatch res;
+ // Enable when regex class actually implemented.
+ // VERIFY(regex_match ("abc", res, r));
+ VERIFY(!regex_match ("ab", res, r));
+
+ r = { 'd', 'e', 'f' };
+ // Enable when regex class actually implemented.
+ // VERIFY(regex_match ("def", res, r));
+ VERIFY(!regex_match ("abc", res, r));
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+ return 0;
+}
--- /dev/null
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+//
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <ext/vstring.h>
+#include <testsuite_hooks.h>
+
+int test01(void)
+{
+ bool test = true;
+
+ __gnu_cxx::__vstring s1 = { 'a', 'b', 'c' };
+ VERIFY(s1 == "abc");
+
+ s1 = { 'd', 'e', 'f' };
+ VERIFY(s1 == "def");
+
+ s1 += { 'g', 'h', 'i' };
+ VERIFY(s1 == "defghi");
+
+ s1.append({ 'j', 'k', 'l' });
+ VERIFY(s1 == "defghijkl");
+
+ s1.assign({ 'm', 'n', 'o' });
+ VERIFY(s1 == "mno");
+
+ // There aren't actually overloads of insert and replace taking size_type
+ // and initializer_list, but test the usage anyway.
+ s1.insert(2, { 'p', 'q', 'r' });
+ VERIFY(s1 == "mnpqro");
+
+ s1.replace(2, 3, { 's', 't', 'u' });
+ VERIFY(s1 == "mnstuo");
+
+ __gnu_cxx::__vstring::iterator i1, i2;
+
+ i1 = s1.begin()+2;
+ s1.insert(i1, { 'v', 'w', 'x' });
+ VERIFY(s1 == "mnvwxstuo");
+
+ i1 = s1.begin()+2;
+ i2 = i1+6;
+ s1.replace(i1, i2, { 'y', 'z' });
+ VERIFY(s1 == "mnyzo");
+
+ return test;
+}
+
+int main()
+{
+ __gnu_test::set_memory_limits();
+ test01();
+ return 0;
+}