1 // vector<bool> specialization -*- C++ -*-
3 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 // Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 // As a special exception, you may use this file as part of a free software
23 // library without restriction. Specifically, if other files instantiate
24 // templates or use macros or inline functions from this file, or you compile
25 // this file and link it with other files to produce an executable, this
26 // file does not by itself cause the resulting executable to be covered by
27 // the GNU General Public License. This exception does not however
28 // invalidate any other reasons why the executable file might be covered by
29 // the GNU General Public License.
34 * Hewlett-Packard Company
36 * Permission to use, copy, modify, distribute and sell this software
37 * and its documentation for any purpose is hereby granted without fee,
38 * provided that the above copyright notice appear in all copies and
39 * that both that copyright notice and this permission notice appear
40 * in supporting documentation. Hewlett-Packard Company makes no
41 * representations about the suitability of this software for any
42 * purpose. It is provided "as is" without express or implied warranty.
45 * Copyright (c) 1996-1999
46 * Silicon Graphics Computer Systems, Inc.
48 * Permission to use, copy, modify, distribute and sell this software
49 * and its documentation for any purpose is hereby granted without fee,
50 * provided that the above copyright notice appear in all copies and
51 * that both that copyright notice and this permission notice appear
52 * in supporting documentation. Silicon Graphics makes no
53 * representations about the suitability of this software for any
54 * purpose. It is provided "as is" without express or implied warranty.
57 /** @file stl_bvector.h
58 * This is an internal header file, included by other library headers.
59 * You should not attempt to use it directly.
62 #ifndef _STL_BVECTOR_H
63 #define _STL_BVECTOR_H 1
65 #include <initializer_list>
67 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std
, _GLIBCXX_STD_D
)
69 typedef unsigned long _Bit_type
;
70 enum { _S_word_bit
= int(__CHAR_BIT__
* sizeof(_Bit_type
)) };
77 _Bit_reference(_Bit_type
* __x
, _Bit_type __y
)
78 : _M_p(__x
), _M_mask(__y
) { }
80 _Bit_reference() : _M_p(0), _M_mask(0) { }
83 { return !!(*_M_p
& _M_mask
); }
96 operator=(const _Bit_reference
& __x
)
97 { return *this = bool(__x
); }
100 operator==(const _Bit_reference
& __x
) const
101 { return bool(*this) == bool(__x
); }
104 operator<(const _Bit_reference
& __x
) const
105 { return !bool(*this) && bool(__x
); }
109 { *_M_p
^= _M_mask
; }
112 struct _Bit_iterator_base
113 : public std::iterator
<std::random_access_iterator_tag
, bool>
116 unsigned int _M_offset
;
118 _Bit_iterator_base(_Bit_type
* __x
, unsigned int __y
)
119 : _M_p(__x
), _M_offset(__y
) { }
124 if (_M_offset
++ == int(_S_word_bit
) - 1)
134 if (_M_offset
-- == 0)
136 _M_offset
= int(_S_word_bit
) - 1;
142 _M_incr(ptrdiff_t __i
)
144 difference_type __n
= __i
+ _M_offset
;
145 _M_p
+= __n
/ int(_S_word_bit
);
146 __n
= __n
% int(_S_word_bit
);
149 __n
+= int(_S_word_bit
);
152 _M_offset
= static_cast<unsigned int>(__n
);
156 operator==(const _Bit_iterator_base
& __i
) const
157 { return _M_p
== __i
._M_p
&& _M_offset
== __i
._M_offset
; }
160 operator<(const _Bit_iterator_base
& __i
) const
162 return _M_p
< __i
._M_p
163 || (_M_p
== __i
._M_p
&& _M_offset
< __i
._M_offset
);
167 operator!=(const _Bit_iterator_base
& __i
) const
168 { return !(*this == __i
); }
171 operator>(const _Bit_iterator_base
& __i
) const
172 { return __i
< *this; }
175 operator<=(const _Bit_iterator_base
& __i
) const
176 { return !(__i
< *this); }
179 operator>=(const _Bit_iterator_base
& __i
) const
180 { return !(*this < __i
); }
184 operator-(const _Bit_iterator_base
& __x
, const _Bit_iterator_base
& __y
)
186 return (int(_S_word_bit
) * (__x
._M_p
- __y
._M_p
)
187 + __x
._M_offset
- __y
._M_offset
);
190 struct _Bit_iterator
: public _Bit_iterator_base
192 typedef _Bit_reference reference
;
193 typedef _Bit_reference
* pointer
;
194 typedef _Bit_iterator iterator
;
196 _Bit_iterator() : _Bit_iterator_base(0, 0) { }
198 _Bit_iterator(_Bit_type
* __x
, unsigned int __y
)
199 : _Bit_iterator_base(__x
, __y
) { }
203 { return reference(_M_p
, 1UL << _M_offset
); }
215 iterator __tmp
= *this;
230 iterator __tmp
= *this;
236 operator+=(difference_type __i
)
243 operator-=(difference_type __i
)
250 operator+(difference_type __i
) const
252 iterator __tmp
= *this;
257 operator-(difference_type __i
) const
259 iterator __tmp
= *this;
264 operator[](difference_type __i
) const
265 { return *(*this + __i
); }
269 operator+(ptrdiff_t __n
, const _Bit_iterator
& __x
)
270 { return __x
+ __n
; }
272 struct _Bit_const_iterator
: public _Bit_iterator_base
274 typedef bool reference
;
275 typedef bool const_reference
;
276 typedef const bool* pointer
;
277 typedef _Bit_const_iterator const_iterator
;
279 _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
281 _Bit_const_iterator(_Bit_type
* __x
, unsigned int __y
)
282 : _Bit_iterator_base(__x
, __y
) { }
284 _Bit_const_iterator(const _Bit_iterator
& __x
)
285 : _Bit_iterator_base(__x
._M_p
, __x
._M_offset
) { }
289 { return _Bit_reference(_M_p
, 1UL << _M_offset
); }
301 const_iterator __tmp
= *this;
316 const_iterator __tmp
= *this;
322 operator+=(difference_type __i
)
329 operator-=(difference_type __i
)
336 operator+(difference_type __i
) const
338 const_iterator __tmp
= *this;
343 operator-(difference_type __i
) const
345 const_iterator __tmp
= *this;
350 operator[](difference_type __i
) const
351 { return *(*this + __i
); }
354 inline _Bit_const_iterator
355 operator+(ptrdiff_t __n
, const _Bit_const_iterator
& __x
)
356 { return __x
+ __n
; }
359 __fill_bvector(_Bit_iterator __first
, _Bit_iterator __last
, bool __x
)
361 for (; __first
!= __last
; ++__first
)
366 fill(_Bit_iterator __first
, _Bit_iterator __last
, const bool& __x
)
368 if (__first
._M_p
!= __last
._M_p
)
370 std::fill(__first
._M_p
+ 1, __last
._M_p
, __x
? ~0 : 0);
371 __fill_bvector(__first
, _Bit_iterator(__first
._M_p
+ 1, 0), __x
);
372 __fill_bvector(_Bit_iterator(__last
._M_p
, 0), __last
, __x
);
375 __fill_bvector(__first
, __last
, __x
);
378 template<typename _Alloc
>
381 typedef typename
_Alloc::template rebind
<_Bit_type
>::other
385 : public _Bit_alloc_type
387 _Bit_iterator _M_start
;
388 _Bit_iterator _M_finish
;
389 _Bit_type
* _M_end_of_storage
;
392 : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0)
395 _Bvector_impl(const _Bit_alloc_type
& __a
)
396 : _Bit_alloc_type(__a
), _M_start(), _M_finish(), _M_end_of_storage(0)
401 typedef _Alloc allocator_type
;
404 _M_get_Bit_allocator()
405 { return *static_cast<_Bit_alloc_type
*>(&this->_M_impl
); }
407 const _Bit_alloc_type
&
408 _M_get_Bit_allocator() const
409 { return *static_cast<const _Bit_alloc_type
*>(&this->_M_impl
); }
412 get_allocator() const
413 { return allocator_type(_M_get_Bit_allocator()); }
418 _Bvector_base(const allocator_type
& __a
)
421 #ifdef __GXX_EXPERIMENTAL_CXX0X__
422 _Bvector_base(_Bvector_base
&& __x
)
423 : _M_impl(__x
._M_get_Bit_allocator())
425 this->_M_impl
._M_start
= __x
._M_impl
._M_start
;
426 this->_M_impl
._M_finish
= __x
._M_impl
._M_finish
;
427 this->_M_impl
._M_end_of_storage
= __x
._M_impl
._M_end_of_storage
;
428 __x
._M_impl
._M_start
= _Bit_iterator();
429 __x
._M_impl
._M_finish
= _Bit_iterator();
430 __x
._M_impl
._M_end_of_storage
= 0;
435 { this->_M_deallocate(); }
438 _Bvector_impl _M_impl
;
441 _M_allocate(size_t __n
)
442 { return _M_impl
.allocate((__n
+ int(_S_word_bit
) - 1)
443 / int(_S_word_bit
)); }
448 if (_M_impl
._M_start
._M_p
)
449 _M_impl
.deallocate(_M_impl
._M_start
._M_p
,
450 _M_impl
._M_end_of_storage
- _M_impl
._M_start
._M_p
);
454 _GLIBCXX_END_NESTED_NAMESPACE
456 // Declare a partial specialization of vector<T, Alloc>.
457 #include <bits/stl_vector.h>
459 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std
, _GLIBCXX_STD_D
)
462 * @brief A specialization of vector for booleans which offers fixed time
463 * access to individual elements in any order.
465 * Note that vector<bool> does not actually meet the requirements for being
466 * a container. This is because the reference and pointer types are not
467 * really references and pointers to bool. See DR96 for details. @see
468 * vector for function documentation.
470 * @ingroup Containers
473 * In some terminology a %vector can be described as a dynamic
474 * C-style array, it offers fast and efficient access to individual
475 * elements in any order and saves the user from worrying about
476 * memory and size allocation. Subscripting ( @c [] ) access is
477 * also provided as with C-style arrays.
479 template<typename _Alloc
>
480 class vector
<bool, _Alloc
> : protected _Bvector_base
<_Alloc
>
482 typedef _Bvector_base
<_Alloc
> _Base
;
485 typedef bool value_type
;
486 typedef size_t size_type
;
487 typedef ptrdiff_t difference_type
;
488 typedef _Bit_reference reference
;
489 typedef bool const_reference
;
490 typedef _Bit_reference
* pointer
;
491 typedef const bool* const_pointer
;
492 typedef _Bit_iterator iterator
;
493 typedef _Bit_const_iterator const_iterator
;
494 typedef std::reverse_iterator
<const_iterator
> const_reverse_iterator
;
495 typedef std::reverse_iterator
<iterator
> reverse_iterator
;
496 typedef _Alloc allocator_type
;
498 allocator_type
get_allocator() const
499 { return _Base::get_allocator(); }
502 using _Base::_M_allocate
;
503 using _Base::_M_deallocate
;
504 using _Base::_M_get_Bit_allocator
;
511 vector(const allocator_type
& __a
)
515 vector(size_type __n
, const bool& __value
= bool(),
516 const allocator_type
& __a
= allocator_type())
520 std::fill(this->_M_impl
._M_start
._M_p
, this->_M_impl
._M_end_of_storage
,
524 vector(const vector
& __x
)
525 : _Base(__x
._M_get_Bit_allocator())
527 _M_initialize(__x
.size());
528 _M_copy_aligned(__x
.begin(), __x
.end(), this->_M_impl
._M_start
);
531 #ifdef __GXX_EXPERIMENTAL_CXX0X__
533 : _Base(std::forward
<_Base
>(__x
)) { }
535 vector(initializer_list
<bool> __l
,
536 const allocator_type
& __a
= allocator_type())
539 _M_initialize_range(__l
.begin(), __l
.end(),
540 random_access_iterator_tag());
544 template<typename _InputIterator
>
545 vector(_InputIterator __first
, _InputIterator __last
,
546 const allocator_type
& __a
= allocator_type())
549 typedef typename
std::__is_integer
<_InputIterator
>::__type _Integral
;
550 _M_initialize_dispatch(__first
, __last
, _Integral());
556 operator=(const vector
& __x
)
560 if (__x
.size() > capacity())
562 this->_M_deallocate();
563 _M_initialize(__x
.size());
565 this->_M_impl
._M_finish
= _M_copy_aligned(__x
.begin(), __x
.end(),
570 #ifdef __GXX_EXPERIMENTAL_CXX0X__
572 operator=(vector
&& __x
)
581 operator=(initializer_list
<bool> __l
)
583 this->assign (__l
.begin(), __l
.end());
588 // assign(), a generalized assignment member function. Two
589 // versions: one that takes a count, and one that takes a range.
590 // The range version is a member template, so we dispatch on whether
591 // or not the type is an integer.
593 assign(size_type __n
, const bool& __x
)
594 { _M_fill_assign(__n
, __x
); }
596 template<typename _InputIterator
>
598 assign(_InputIterator __first
, _InputIterator __last
)
600 typedef typename
std::__is_integer
<_InputIterator
>::__type _Integral
;
601 _M_assign_dispatch(__first
, __last
, _Integral());
604 #ifdef __GXX_EXPERIMENTAL_CXX0X__
606 assign(initializer_list
<bool> __l
)
607 { this->assign(__l
.begin(), __l
.end()); }
612 { return this->_M_impl
._M_start
; }
616 { return this->_M_impl
._M_start
; }
620 { return this->_M_impl
._M_finish
; }
624 { return this->_M_impl
._M_finish
; }
628 { return reverse_iterator(end()); }
630 const_reverse_iterator
632 { return const_reverse_iterator(end()); }
636 { return reverse_iterator(begin()); }
638 const_reverse_iterator
640 { return const_reverse_iterator(begin()); }
642 #ifdef __GXX_EXPERIMENTAL_CXX0X__
645 { return this->_M_impl
._M_start
; }
649 { return this->_M_impl
._M_finish
; }
651 const_reverse_iterator
653 { return const_reverse_iterator(end()); }
655 const_reverse_iterator
657 { return const_reverse_iterator(begin()); }
662 { return size_type(end() - begin()); }
667 const size_type __isize
=
668 __gnu_cxx::__numeric_traits
<difference_type
>::__max
669 - int(_S_word_bit
) + 1;
670 const size_type __asize
= _M_get_Bit_allocator().max_size();
671 return (__asize
<= __isize
/ int(_S_word_bit
)
672 ? __asize
* int(_S_word_bit
) : __isize
);
677 { return size_type(const_iterator(this->_M_impl
._M_end_of_storage
, 0)
682 { return begin() == end(); }
685 operator[](size_type __n
)
687 return *iterator(this->_M_impl
._M_start
._M_p
688 + __n
/ int(_S_word_bit
), __n
% int(_S_word_bit
));
692 operator[](size_type __n
) const
694 return *const_iterator(this->_M_impl
._M_start
._M_p
695 + __n
/ int(_S_word_bit
), __n
% int(_S_word_bit
));
700 _M_range_check(size_type __n
) const
702 if (__n
>= this->size())
703 __throw_out_of_range(__N("vector<bool>::_M_range_check"));
709 { _M_range_check(__n
); return (*this)[__n
]; }
712 at(size_type __n
) const
713 { _M_range_check(__n
); return (*this)[__n
]; }
716 reserve(size_type __n
);
728 { return *(end() - 1); }
732 { return *(end() - 1); }
734 // _GLIBCXX_RESOLVE_LIB_DEFECTS
735 // DR 464. Suggestion for new member functions in standard containers.
736 // N.B. DR 464 says nothing about vector<bool> but we need something
737 // here due to the way we are implementing DR 464 in the debug-mode
745 if (this->_M_impl
._M_finish
._M_p
!= this->_M_impl
._M_end_of_storage
)
746 *this->_M_impl
._M_finish
++ = __x
;
748 _M_insert_aux(end(), __x
);
752 #ifdef __GXX_EXPERIMENTAL_CXX0X__
758 std::swap(this->_M_impl
._M_start
, __x
._M_impl
._M_start
);
759 std::swap(this->_M_impl
._M_finish
, __x
._M_impl
._M_finish
);
760 std::swap(this->_M_impl
._M_end_of_storage
,
761 __x
._M_impl
._M_end_of_storage
);
763 // _GLIBCXX_RESOLVE_LIB_DEFECTS
764 // 431. Swapping containers with unequal allocators.
765 std::__alloc_swap
<typename
_Base::_Bit_alloc_type
>::
766 _S_do_it(_M_get_Bit_allocator(), __x
._M_get_Bit_allocator());
769 // [23.2.5]/1, third-to-last entry in synopsis listing
771 swap(reference __x
, reference __y
)
779 insert(iterator __position
, const bool& __x
= bool())
781 const difference_type __n
= __position
- begin();
782 if (this->_M_impl
._M_finish
._M_p
!= this->_M_impl
._M_end_of_storage
783 && __position
== end())
784 *this->_M_impl
._M_finish
++ = __x
;
786 _M_insert_aux(__position
, __x
);
787 return begin() + __n
;
790 template<typename _InputIterator
>
792 insert(iterator __position
,
793 _InputIterator __first
, _InputIterator __last
)
795 typedef typename
std::__is_integer
<_InputIterator
>::__type _Integral
;
796 _M_insert_dispatch(__position
, __first
, __last
, _Integral());
800 insert(iterator __position
, size_type __n
, const bool& __x
)
801 { _M_fill_insert(__position
, __n
, __x
); }
803 #ifdef __GXX_EXPERIMENTAL_CXX0X__
804 void insert(iterator __p
, initializer_list
<bool> __l
)
805 { this->insert(__p
, __l
.begin(), __l
.end()); }
810 { --this->_M_impl
._M_finish
; }
813 erase(iterator __position
)
815 if (__position
+ 1 != end())
816 std::copy(__position
+ 1, end(), __position
);
817 --this->_M_impl
._M_finish
;
822 erase(iterator __first
, iterator __last
)
824 _M_erase_at_end(std::copy(__last
, end(), __first
));
829 resize(size_type __new_size
, bool __x
= bool())
831 if (__new_size
< size())
832 _M_erase_at_end(begin() + difference_type(__new_size
));
834 insert(end(), __new_size
- size(), __x
);
840 for (_Bit_type
* __p
= this->_M_impl
._M_start
._M_p
;
841 __p
!= this->_M_impl
._M_end_of_storage
; ++__p
)
847 { _M_erase_at_end(begin()); }
851 // Precondition: __first._M_offset == 0 && __result._M_offset == 0.
853 _M_copy_aligned(const_iterator __first
, const_iterator __last
,
856 _Bit_type
* __q
= std::copy(__first
._M_p
, __last
._M_p
, __result
._M_p
);
857 return std::copy(const_iterator(__last
._M_p
, 0), __last
,
862 _M_initialize(size_type __n
)
864 _Bit_type
* __q
= this->_M_allocate(__n
);
865 this->_M_impl
._M_end_of_storage
= (__q
866 + ((__n
+ int(_S_word_bit
) - 1)
867 / int(_S_word_bit
)));
868 this->_M_impl
._M_start
= iterator(__q
, 0);
869 this->_M_impl
._M_finish
= this->_M_impl
._M_start
+ difference_type(__n
);
872 // Check whether it's an integral type. If so, it's not an iterator.
874 // _GLIBCXX_RESOLVE_LIB_DEFECTS
875 // 438. Ambiguity in the "do the right thing" clause
876 template<typename _Integer
>
878 _M_initialize_dispatch(_Integer __n
, _Integer __x
, __true_type
)
880 _M_initialize(static_cast<size_type
>(__n
));
881 std::fill(this->_M_impl
._M_start
._M_p
,
882 this->_M_impl
._M_end_of_storage
, __x
? ~0 : 0);
885 template<typename _InputIterator
>
887 _M_initialize_dispatch(_InputIterator __first
, _InputIterator __last
,
889 { _M_initialize_range(__first
, __last
,
890 std::__iterator_category(__first
)); }
892 template<typename _InputIterator
>
894 _M_initialize_range(_InputIterator __first
, _InputIterator __last
,
895 std::input_iterator_tag
)
897 for (; __first
!= __last
; ++__first
)
901 template<typename _ForwardIterator
>
903 _M_initialize_range(_ForwardIterator __first
, _ForwardIterator __last
,
904 std::forward_iterator_tag
)
906 const size_type __n
= std::distance(__first
, __last
);
908 std::copy(__first
, __last
, this->_M_impl
._M_start
);
911 // _GLIBCXX_RESOLVE_LIB_DEFECTS
912 // 438. Ambiguity in the "do the right thing" clause
913 template<typename _Integer
>
915 _M_assign_dispatch(_Integer __n
, _Integer __val
, __true_type
)
916 { _M_fill_assign(__n
, __val
); }
918 template<class _InputIterator
>
920 _M_assign_dispatch(_InputIterator __first
, _InputIterator __last
,
922 { _M_assign_aux(__first
, __last
, std::__iterator_category(__first
)); }
925 _M_fill_assign(size_t __n
, bool __x
)
929 std::fill(this->_M_impl
._M_start
._M_p
,
930 this->_M_impl
._M_end_of_storage
, __x
? ~0 : 0);
931 insert(end(), __n
- size(), __x
);
935 _M_erase_at_end(begin() + __n
);
936 std::fill(this->_M_impl
._M_start
._M_p
,
937 this->_M_impl
._M_end_of_storage
, __x
? ~0 : 0);
941 template<typename _InputIterator
>
943 _M_assign_aux(_InputIterator __first
, _InputIterator __last
,
944 std::input_iterator_tag
)
946 iterator __cur
= begin();
947 for (; __first
!= __last
&& __cur
!= end(); ++__cur
, ++__first
)
949 if (__first
== __last
)
950 _M_erase_at_end(__cur
);
952 insert(end(), __first
, __last
);
955 template<typename _ForwardIterator
>
957 _M_assign_aux(_ForwardIterator __first
, _ForwardIterator __last
,
958 std::forward_iterator_tag
)
960 const size_type __len
= std::distance(__first
, __last
);
962 _M_erase_at_end(std::copy(__first
, __last
, begin()));
965 _ForwardIterator __mid
= __first
;
966 std::advance(__mid
, size());
967 std::copy(__first
, __mid
, begin());
968 insert(end(), __mid
, __last
);
972 // Check whether it's an integral type. If so, it's not an iterator.
974 // _GLIBCXX_RESOLVE_LIB_DEFECTS
975 // 438. Ambiguity in the "do the right thing" clause
976 template<typename _Integer
>
978 _M_insert_dispatch(iterator __pos
, _Integer __n
, _Integer __x
,
980 { _M_fill_insert(__pos
, __n
, __x
); }
982 template<typename _InputIterator
>
984 _M_insert_dispatch(iterator __pos
,
985 _InputIterator __first
, _InputIterator __last
,
987 { _M_insert_range(__pos
, __first
, __last
,
988 std::__iterator_category(__first
)); }
991 _M_fill_insert(iterator __position
, size_type __n
, bool __x
);
993 template<typename _InputIterator
>
995 _M_insert_range(iterator __pos
, _InputIterator __first
,
996 _InputIterator __last
, std::input_iterator_tag
)
998 for (; __first
!= __last
; ++__first
)
1000 __pos
= insert(__pos
, *__first
);
1005 template<typename _ForwardIterator
>
1007 _M_insert_range(iterator __position
, _ForwardIterator __first
,
1008 _ForwardIterator __last
, std::forward_iterator_tag
);
1011 _M_insert_aux(iterator __position
, bool __x
);
1014 _M_check_len(size_type __n
, const char* __s
) const
1016 if (max_size() - size() < __n
)
1017 __throw_length_error(__N(__s
));
1019 const size_type __len
= size() + std::max(size(), __n
);
1020 return (__len
< size() || __len
> max_size()) ? max_size() : __len
;
1024 _M_erase_at_end(iterator __pos
)
1025 { this->_M_impl
._M_finish
= __pos
; }
1028 _GLIBCXX_END_NESTED_NAMESPACE