Commit 0a2bf188 by Jonathan Wakely Committed by Jonathan Wakely

Improve doxygen comments for allocators in containers

	PR libstdc++/70716
	* include/bits/forward_list.h (forward_list): Update doxygen comments
	to reflect allocator propagation semantics. Remove ambiguous
	statements about data being lost.
	* include/bits/stl_deque.h (deque): Likewise.
	* include/bits/stl_list.h (list): Likewise.
	* include/bits/stl_map.h (map): Likewise.
	* include/bits/stl_multimap.h (multimap): Likewise.
	* include/bits/stl_multiset.h (multiset): Likewise.
	* include/bits/stl_set.h (set): Likewise.
	* include/bits/stl_vector.h (vector): Likewise.
	* include/bits/unordered_map.h (unordered_map, unordered_multimap):
	Likewise.
	* include/bits/unordered_set.h (unordered_set, unordered_multiset):
	Likewise.

From-SVN: r238332
parent 94c32c00
2016-07-14 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/70716
* include/bits/forward_list.h (forward_list): Update doxygen comments
to reflect allocator propagation semantics. Remove ambiguous
statements about data being lost.
* include/bits/stl_deque.h (deque): Likewise.
* include/bits/stl_list.h (list): Likewise.
* include/bits/stl_map.h (map): Likewise.
* include/bits/stl_multimap.h (multimap): Likewise.
* include/bits/stl_multiset.h (multiset): Likewise.
* include/bits/stl_set.h (set): Likewise.
* include/bits/stl_vector.h (vector): Likewise.
* include/bits/unordered_map.h (unordered_map, unordered_multimap):
Likewise.
* include/bits/unordered_set.h (unordered_set, unordered_multiset):
Likewise.
2016-07-14 Ville Voutilainen <ville.voutilainen@gmail.com> 2016-07-14 Ville Voutilainen <ville.voutilainen@gmail.com>
Implement P0032R3, Homogeneous interface for variant, any and optional, Implement P0032R3, Homogeneous interface for variant, any and optional,
......
...@@ -566,8 +566,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -566,8 +566,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @param __list A %forward_list of identical element and allocator * @param __list A %forward_list of identical element and allocator
* types. * types.
* *
* All the elements of @a __list are copied, but unlike the copy * All the elements of @a __list are copied.
* constructor, the allocator object is not copied. *
* Whether the allocator is copied depends on the allocator traits.
*/ */
forward_list& forward_list&
operator=(const forward_list& __list); operator=(const forward_list& __list);
...@@ -579,7 +580,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -579,7 +580,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* The contents of @a __list are moved into this %forward_list * The contents of @a __list are moved into this %forward_list
* (without copying, if the allocators permit it). * (without copying, if the allocators permit it).
* @a __list is a valid, but unspecified %forward_list *
* Afterwards @a __list is a valid, but unspecified %forward_list
*
* Whether the allocator is moved depends on the allocator traits.
*/ */
forward_list& forward_list&
operator=(forward_list&& __list) operator=(forward_list&& __list)
...@@ -617,7 +621,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -617,7 +621,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %forward_list and * Note that the assignment completely changes the %forward_list and
* that the number of elements of the resulting %forward_list is the * that the number of elements of the resulting %forward_list is the
* same as the number of elements assigned. Old data is lost. * same as the number of elements assigned.
*/ */
template<typename _InputIterator, template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>> typename = std::_RequireInputIter<_InputIterator>>
...@@ -636,7 +640,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -636,7 +640,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* This function fills a %forward_list with @a __n copies of the * This function fills a %forward_list with @a __n copies of the
* given value. Note that the assignment completely changes the * given value. Note that the assignment completely changes the
* %forward_list, and that the resulting %forward_list has __n * %forward_list, and that the resulting %forward_list has __n
* elements. Old data is lost. * elements.
*/ */
void void
assign(size_type __n, const _Tp& __val) assign(size_type __n, const _Tp& __val)
...@@ -991,6 +995,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -991,6 +995,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* time. Note that the global std::swap() function is * time. Note that the global std::swap() function is
* specialized such that std::swap(l1,l2) will feed to this * specialized such that std::swap(l1,l2) will feed to this
* function. * function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(forward_list& __list) noexcept swap(forward_list& __list) noexcept
......
...@@ -939,8 +939,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -939,8 +939,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Deque copy constructor. * @brief %Deque copy constructor.
* @param __x A %deque of identical element and allocator types. * @param __x A %deque of identical element and allocator types.
* *
* The newly-created %deque uses a copy of the allocation object used * The newly-created %deque uses a copy of the allocator object used
* by @a __x. * by @a __x (unless the allocator traits dictate a different object).
*/ */
deque(const deque& __x) deque(const deque& __x)
: _Base(_Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()), : _Base(_Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()),
...@@ -1046,8 +1046,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1046,8 +1046,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Deque assignment operator. * @brief %Deque assignment operator.
* @param __x A %deque of identical element and allocator types. * @param __x A %deque of identical element and allocator types.
* *
* All the elements of @a x are copied, but unlike the copy constructor, * All the elements of @a x are copied.
* the allocator object is not copied. *
* The newly-created %deque uses a copy of the allocator object used
* by @a __x (unless the allocator traits dictate a different object).
*/ */
deque& deque&
operator=(const deque& __x); operator=(const deque& __x);
...@@ -1078,7 +1080,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1078,7 +1080,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %deque and that the * Note that the assignment completely changes the %deque and that the
* resulting %deque's size is the same as the number of elements * resulting %deque's size is the same as the number of elements
* assigned. Old data may be lost. * assigned.
*/ */
deque& deque&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -1097,7 +1099,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1097,7 +1099,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* This function fills a %deque with @a n copies of the given * This function fills a %deque with @a n copies of the given
* value. Note that the assignment completely changes the * value. Note that the assignment completely changes the
* %deque and that the resulting %deque's size is the same as * %deque and that the resulting %deque's size is the same as
* the number of elements assigned. Old data may be lost. * the number of elements assigned.
*/ */
void void
assign(size_type __n, const value_type& __val) assign(size_type __n, const value_type& __val)
...@@ -1113,7 +1115,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1113,7 +1115,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %deque and that the * Note that the assignment completely changes the %deque and that the
* resulting %deque's size is the same as the number of elements * resulting %deque's size is the same as the number of elements
* assigned. Old data may be lost. * assigned.
*/ */
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
template<typename _InputIterator, template<typename _InputIterator,
...@@ -1141,7 +1143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1141,7 +1143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %deque and that the * Note that the assignment completely changes the %deque and that the
* resulting %deque's size is the same as the number of elements * resulting %deque's size is the same as the number of elements
* assigned. Old data may be lost. * assigned.
*/ */
void void
assign(initializer_list<value_type> __l) assign(initializer_list<value_type> __l)
...@@ -1803,6 +1805,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1803,6 +1805,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* (Four pointers, so it should be quite fast.) * (Four pointers, so it should be quite fast.)
* Note that the global std::swap() function is specialized such that * Note that the global std::swap() function is specialized such that
* std::swap(d1,d2) will feed to this function. * std::swap(d1,d2) will feed to this function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(deque& __x) _GLIBCXX_NOEXCEPT swap(deque& __x) _GLIBCXX_NOEXCEPT
......
...@@ -643,7 +643,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -643,7 +643,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
* @param __x A %list of identical element and allocator types. * @param __x A %list of identical element and allocator types.
* *
* The newly-created %list uses a copy of the allocation object used * The newly-created %list uses a copy of the allocation object used
* by @a __x. * by @a __x (unless the allocator traits dictate a different object).
*/ */
list(const list& __x) list(const list& __x)
: _Base(_Node_alloc_traits:: : _Base(_Node_alloc_traits::
...@@ -718,6 +718,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -718,6 +718,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
} }
#endif #endif
#if __cplusplus >= 201103L
/** /**
* No explicit dtor needed as the _Base dtor takes care of * No explicit dtor needed as the _Base dtor takes care of
* things. The _Base dtor only erases the elements, and note * things. The _Base dtor only erases the elements, and note
...@@ -725,13 +726,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -725,13 +726,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
* memory is not touched in any way. Managing the pointer is * memory is not touched in any way. Managing the pointer is
* the user's responsibility. * the user's responsibility.
*/ */
~list() = default;
#endif
/** /**
* @brief %List assignment operator. * @brief %List assignment operator.
* @param __x A %list of identical element and allocator types. * @param __x A %list of identical element and allocator types.
* *
* All the elements of @a __x are copied, but unlike the copy * All the elements of @a __x are copied.
* constructor, the allocator object is not copied. *
* Whether the allocator is copied depends on the allocator traits.
*/ */
list& list&
operator=(const list& __x); operator=(const list& __x);
...@@ -742,7 +746,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -742,7 +746,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
* @param __x A %list of identical element and allocator types. * @param __x A %list of identical element and allocator types.
* *
* The contents of @a __x are moved into this %list (without copying). * The contents of @a __x are moved into this %list (without copying).
* @a __x is a valid, but unspecified %list *
* Afterwards @a __x is a valid, but unspecified %list
*
* Whether the allocator is moved depends on the allocator traits.
*/ */
list& list&
operator=(list&& __x) operator=(list&& __x)
...@@ -778,7 +785,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -778,7 +785,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
* This function fills a %list with @a __n copies of the given * This function fills a %list with @a __n copies of the given
* value. Note that the assignment completely changes the %list * value. Note that the assignment completely changes the %list
* and that the resulting %list's size is the same as the number * and that the resulting %list's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
void void
assign(size_type __n, const value_type& __val) assign(size_type __n, const value_type& __val)
...@@ -794,7 +801,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -794,7 +801,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
* *
* Note that the assignment completely changes the %list and * Note that the assignment completely changes the %list and
* that the resulting %list's size is the same as the number of * that the resulting %list's size is the same as the number of
* elements assigned. Old data may be lost. * elements assigned.
*/ */
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
template<typename _InputIterator, template<typename _InputIterator,
...@@ -1348,6 +1355,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -1348,6 +1355,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
* time. Note that the global std::swap() function is * time. Note that the global std::swap() function is
* specialized such that std::swap(l1,l2) will feed to this * specialized such that std::swap(l1,l2) will feed to this
* function. * function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(list& __x) _GLIBCXX_NOEXCEPT swap(list& __x) _GLIBCXX_NOEXCEPT
......
...@@ -179,8 +179,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -179,8 +179,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Map copy constructor. * @brief %Map copy constructor.
* @param __x A %map of identical element and allocator types. * @param __x A %map of identical element and allocator types.
* *
* The newly-created %map uses a copy of the allocation object * The newly-created %map uses a copy of the allocator object used
* used by @a __x. * by @a __x (unless the allocator traits dictate a different object).
*/ */
map(const map& __x) map(const map& __x)
: _M_t(__x._M_t) { } : _M_t(__x._M_t) { }
...@@ -289,8 +289,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -289,8 +289,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Map assignment operator. * @brief %Map assignment operator.
* @param __x A %map of identical element and allocator types. * @param __x A %map of identical element and allocator types.
* *
* All the elements of @a __x are copied, but unlike the copy * All the elements of @a __x are copied.
* constructor, the allocator object is not copied. *
* Whether the allocator is copied depends on the allocator traits.
*/ */
map& map&
operator=(const map& __x) operator=(const map& __x)
...@@ -313,7 +314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -313,7 +314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %map and * Note that the assignment completely changes the %map and
* that the resulting %map's size is the same as the number * that the resulting %map's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
map& map&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -1027,6 +1028,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1027,6 +1028,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* stateless and empty), so it should be quite fast.) Note * stateless and empty), so it should be quite fast.) Note
* that the global std::swap() function is specialized such * that the global std::swap() function is specialized such
* that std::swap(m1,m2) will feed to this function. * that std::swap(m1,m2) will feed to this function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(map& __x) swap(map& __x)
......
...@@ -177,8 +177,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -177,8 +177,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Multimap copy constructor. * @brief %Multimap copy constructor.
* @param __x A %multimap of identical element and allocator types. * @param __x A %multimap of identical element and allocator types.
* *
* The newly-created %multimap uses a copy of the allocation object * The newly-created %multimap uses a copy of the allocator object used
* used by @a __x. * by @a __x (unless the allocator traits dictate a different object).
*/ */
multimap(const multimap& __x) multimap(const multimap& __x)
: _M_t(__x._M_t) { } : _M_t(__x._M_t) { }
...@@ -284,8 +284,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -284,8 +284,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Multimap assignment operator. * @brief %Multimap assignment operator.
* @param __x A %multimap of identical element and allocator types. * @param __x A %multimap of identical element and allocator types.
* *
* All the elements of @a __x are copied, but unlike the copy * All the elements of @a __x are copied.
* constructor, the allocator object is not copied. *
* Whether the allocator is copied depends on the allocator traits.
*/ */
multimap& multimap&
operator=(const multimap& __x) operator=(const multimap& __x)
...@@ -308,7 +309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -308,7 +309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %multimap and * Note that the assignment completely changes the %multimap and
* that the resulting %multimap's size is the same as the number * that the resulting %multimap's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
multimap& multimap&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -701,6 +702,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -701,6 +702,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* should be quite fast.) * should be quite fast.)
* Note that the global std::swap() function is specialized such that * Note that the global std::swap() function is specialized such that
* std::swap(m1,m2) will feed to this function. * std::swap(m1,m2) will feed to this function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(multimap& __x) swap(multimap& __x)
......
...@@ -189,8 +189,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -189,8 +189,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Multiset copy constructor. * @brief %Multiset copy constructor.
* @param __x A %multiset of identical element and allocator types. * @param __x A %multiset of identical element and allocator types.
* *
* The newly-created %multiset uses a copy of the allocation object used * The newly-created %multiset uses a copy of the allocator object used
* by @a __x. * by @a __x (unless the allocator traits dictate a different object).
*/ */
multiset(const multiset& __x) multiset(const multiset& __x)
: _M_t(__x._M_t) { } : _M_t(__x._M_t) { }
...@@ -255,8 +255,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -255,8 +255,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Multiset assignment operator. * @brief %Multiset assignment operator.
* @param __x A %multiset of identical element and allocator types. * @param __x A %multiset of identical element and allocator types.
* *
* All the elements of @a __x are copied, but unlike the copy * All the elements of @a __x are copied.
* constructor, the allocator object is not copied. *
* Whether the allocator is copied depends on the allocator traits.
*/ */
multiset& multiset&
operator=(const multiset& __x) operator=(const multiset& __x)
...@@ -279,7 +280,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -279,7 +280,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %multiset and * Note that the assignment completely changes the %multiset and
* that the resulting %multiset's size is the same as the number * that the resulting %multiset's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
multiset& multiset&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -403,6 +404,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -403,6 +404,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* be quite fast.) * be quite fast.)
* Note that the global std::swap() function is specialized such that * Note that the global std::swap() function is specialized such that
* std::swap(s1,s2) will feed to this function. * std::swap(s1,s2) will feed to this function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(multiset& __x) swap(multiset& __x)
......
...@@ -193,8 +193,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -193,8 +193,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Set copy constructor. * @brief %Set copy constructor.
* @param __x A %set of identical element and allocator types. * @param __x A %set of identical element and allocator types.
* *
* The newly-created %set uses a copy of the allocation object used * The newly-created %set uses a copy of the allocator object used
* by @a __x. * by @a __x (unless the allocator traits dictate a different object).
*/ */
set(const set& __x) set(const set& __x)
: _M_t(__x._M_t) { } : _M_t(__x._M_t) { }
...@@ -259,8 +259,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -259,8 +259,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Set assignment operator. * @brief %Set assignment operator.
* @param __x A %set of identical element and allocator types. * @param __x A %set of identical element and allocator types.
* *
* All the elements of @a __x are copied, but unlike the copy * All the elements of @a __x are copied.
* constructor, the allocator object is not copied. *
* Whether the allocator is copied depends on the allocator traits.
*/ */
set& set&
operator=(const set& __x) operator=(const set& __x)
...@@ -283,7 +284,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -283,7 +284,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %set and * Note that the assignment completely changes the %set and
* that the resulting %set's size is the same as the number * that the resulting %set's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
set& set&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -407,6 +408,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -407,6 +408,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* stateless and empty), so it should be quite fast.) Note * stateless and empty), so it should be quite fast.) Note
* that the global std::swap() function is specialized such * that the global std::swap() function is specialized such
* that std::swap(s1,s2) will feed to this function. * that std::swap(s1,s2) will feed to this function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(set& __x) swap(set& __x)
......
...@@ -314,10 +314,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -314,10 +314,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Vector copy constructor. * @brief %Vector copy constructor.
* @param __x A %vector of identical element and allocator types. * @param __x A %vector of identical element and allocator types.
* *
* The newly-created %vector uses a copy of the allocation * All the elements of @a __x are copied, but any unused capacity in
* object used by @a __x. All the elements of @a __x are copied, * @a __x will not be copied
* but any extra memory in * (i.e. capacity() == size() in the new %vector).
* @a __x (for fast expansion) will not be copied. *
* The newly-created %vector uses a copy of the allocator object used
* by @a __x (unless the allocator traits dictate a different object).
*/ */
vector(const vector& __x) vector(const vector& __x)
: _Base(__x.size(), : _Base(__x.size(),
...@@ -434,9 +436,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -434,9 +436,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Vector assignment operator. * @brief %Vector assignment operator.
* @param __x A %vector of identical element and allocator types. * @param __x A %vector of identical element and allocator types.
* *
* All the elements of @a __x are copied, but any extra memory in * All the elements of @a __x are copied, but any unused capacity in
* @a __x (for fast expansion) will not be copied. Unlike the * @a __x will not be copied.
* copy constructor, the allocator object is not copied. *
* Whether the allocator is copied depends on the allocator traits.
*/ */
vector& vector&
operator=(const vector& __x); operator=(const vector& __x);
...@@ -448,7 +451,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -448,7 +451,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* The contents of @a __x are moved into this %vector (without copying, * The contents of @a __x are moved into this %vector (without copying,
* if the allocators permit it). * if the allocators permit it).
* @a __x is a valid, but unspecified %vector. * Afterwards @a __x is a valid, but unspecified %vector.
*
* Whether the allocator is moved depends on the allocator traits.
*/ */
vector& vector&
operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
...@@ -469,7 +474,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -469,7 +474,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %vector and * Note that the assignment completely changes the %vector and
* that the resulting %vector's size is the same as the number * that the resulting %vector's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
vector& vector&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -488,7 +493,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -488,7 +493,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* This function fills a %vector with @a __n copies of the given * This function fills a %vector with @a __n copies of the given
* value. Note that the assignment completely changes the * value. Note that the assignment completely changes the
* %vector and that the resulting %vector's size is the same as * %vector and that the resulting %vector's size is the same as
* the number of elements assigned. Old data may be lost. * the number of elements assigned.
*/ */
void void
assign(size_type __n, const value_type& __val) assign(size_type __n, const value_type& __val)
...@@ -504,7 +509,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -504,7 +509,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %vector and * Note that the assignment completely changes the %vector and
* that the resulting %vector's size is the same as the number * that the resulting %vector's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
template<typename _InputIterator, template<typename _InputIterator,
...@@ -533,7 +538,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -533,7 +538,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %vector and * Note that the assignment completely changes the %vector and
* that the resulting %vector's size is the same as the number * that the resulting %vector's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
void void
assign(initializer_list<value_type> __l) assign(initializer_list<value_type> __l)
...@@ -1219,6 +1224,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1219,6 +1224,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* (Three pointers, so it should be quite fast.) * (Three pointers, so it should be quite fast.)
* Note that the global std::swap() function is specialized such that * Note that the global std::swap() function is specialized such that
* std::swap(v1,v2) will feed to this function. * std::swap(v1,v2) will feed to this function.
*
* Whether the allocators are swapped depends on the allocator traits.
*/ */
void void
swap(vector& __x) _GLIBCXX_NOEXCEPT swap(vector& __x) _GLIBCXX_NOEXCEPT
......
...@@ -274,7 +274,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -274,7 +274,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %unordered_map and * Note that the assignment completely changes the %unordered_map and
* that the resulting %unordered_map's size is the same as the number * that the resulting %unordered_map's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
unordered_map& unordered_map&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -283,8 +283,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -283,8 +283,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return *this; return *this;
} }
/// Returns the allocator object with which the %unordered_map was /// Returns the allocator object used by the %unordered_map.
/// constructed.
allocator_type allocator_type
get_allocator() const noexcept get_allocator() const noexcept
{ return _M_h.get_allocator(); } { return _M_h.get_allocator(); }
...@@ -1258,12 +1257,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1258,12 +1257,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @brief %Unordered_multimap list assignment operator. * @brief %Unordered_multimap list assignment operator.
* @param __l An initializer_list. * @param __l An initializer_list.
* *
* This function fills an %unordered_multimap with copies of the elements * This function fills an %unordered_multimap with copies of the
* in the initializer list @a __l. * elements in the initializer list @a __l.
* *
* Note that the assignment completely changes the %unordered_multimap * Note that the assignment completely changes the %unordered_multimap
* and that the resulting %unordered_multimap's size is the same as the * and that the resulting %unordered_multimap's size is the same as the
* number of elements assigned. Old data may be lost. * number of elements assigned.
*/ */
unordered_multimap& unordered_multimap&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -1272,8 +1271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1272,8 +1271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return *this; return *this;
} }
/// Returns the allocator object with which the %unordered_multimap was /// Returns the allocator object used by the %unordered_multimap.
/// constructed.
allocator_type allocator_type
get_allocator() const noexcept get_allocator() const noexcept
{ return _M_h.get_allocator(); } { return _M_h.get_allocator(); }
......
...@@ -268,7 +268,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -268,7 +268,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %unordered_set and * Note that the assignment completely changes the %unordered_set and
* that the resulting %unordered_set's size is the same as the number * that the resulting %unordered_set's size is the same as the number
* of elements assigned. Old data may be lost. * of elements assigned.
*/ */
unordered_set& unordered_set&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -277,8 +277,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -277,8 +277,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return *this; return *this;
} }
/// Returns the allocator object with which the %unordered_set was /// Returns the allocator object used by the %unordered_set.
/// constructed.
allocator_type allocator_type
get_allocator() const noexcept get_allocator() const noexcept
{ return _M_h.get_allocator(); } { return _M_h.get_allocator(); }
...@@ -942,7 +941,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -942,7 +941,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* *
* Note that the assignment completely changes the %unordered_multiset * Note that the assignment completely changes the %unordered_multiset
* and that the resulting %unordered_multiset's size is the same as the * and that the resulting %unordered_multiset's size is the same as the
* number of elements assigned. Old data may be lost. * number of elements assigned.
*/ */
unordered_multiset& unordered_multiset&
operator=(initializer_list<value_type> __l) operator=(initializer_list<value_type> __l)
...@@ -951,8 +950,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -951,8 +950,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return *this; return *this;
} }
/// Returns the allocator object with which the %unordered_multiset was /// Returns the allocator object used by the %unordered_multiset.
/// constructed.
allocator_type allocator_type
get_allocator() const noexcept get_allocator() const noexcept
{ return _M_h.get_allocator(); } { return _M_h.get_allocator(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment