summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/stl_bvector.h
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-16 20:30:50 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-16 20:30:50 +0000
commit954ad4204e85494b2ed5dbb3d29e017f21a73334 (patch)
treea9333721985e67177f1e06a4c7ccc9166503d5bd /libstdc++-v3/include/bits/stl_bvector.h
parent6ed6b935b01bfd2c445fb8ab4a1dd4c42103ad0f (diff)
downloadppe42-gcc-954ad4204e85494b2ed5dbb3d29e017f21a73334.tar.gz
ppe42-gcc-954ad4204e85494b2ed5dbb3d29e017f21a73334.zip
* cp-tree.h (lang_type_class): Remove is_partial_instantiation.
(PARTIAL_INSTANTIATION_P): Remove. (IMPLICIT_TYPENAME_P): Likewise. (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise. (build_typename_type): Remove declaration. (parmlist_is_exprlist): Likewise. * decl.c (build_typename_type): Make it static, remove third parameter. (push_class_binding): Don't do implicit typename stuff. (make_typename_type): Likewise. (lookup_name_real): Likewise. (grokdeclarator): Don't try to convert declarations into initializations. Don't do implicit typename stuff. (parmlist_is_exprlist): Remove. (xref_basetypes): Simplify. * decl2.c (grokfield): Don't try to convert declarations into initializations. (build_anon_union_vars): Do this while processing templates, too. (finish_anon_union): Likewise. * error.c (dump_type): Remove implicit typename handling. * parser.c (cp_parser_diagnose_invalid_type_name): New method. (cp_parser_primary_expression): Correct handling of names not found by unqualified name lookup in templates. (cp_parser_nested_name_specifier_opt): Avoid checking dependency of types when possible. (cp_parser_simple_declaration): Complain intelligently about some invalid declarations. (cp_parser_member_declaration): Likewise. (cp_parser_constructor_declarator_p): Don't check when we're in a function scope. * pt.c (instantiate_class_template): Remove PARTIAL_INSTANTIATION_P gunk. * search.c (lookup_field_r): Don't build implicit typenames. (marked_pushdecls_p): Don't enter dependent base types. (unmarked_pushdecls_p): Likewise. * semantics.c (begin_class_definition): Remove implicit typename stuff. * config/locale/gnu/messages_members.h: Use this-> to refer to unqualified members of base clasess. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/list.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/stdio_filebuf.h: Likewise. * include/ext/stl_rope.h: Likewise. * include/std/std_fstream.h: Likewise. * include/std/std_sstream.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61403 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/stl_bvector.h')
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h106
1 files changed, 56 insertions, 50 deletions
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index da72b6460ab..d334a729d23 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -1,6 +1,6 @@
// bit_vector and vector<bool> specialization -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 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
@@ -374,15 +374,15 @@ template <typename _Alloc>
protected:
void _M_initialize(size_type __n) {
_Bit_type * __q = _M_bit_alloc(__n);
- _M_end_of_storage = __q + (__n + _M_word_bit - 1)/_M_word_bit;
- _M_start = iterator(__q, 0);
- _M_finish = _M_start + difference_type(__n);
+ this->_M_end_of_storage = __q + (__n + _M_word_bit - 1)/_M_word_bit;
+ this->_M_start = iterator(__q, 0);
+ this->_M_finish = this->_M_start + difference_type(__n);
}
void _M_insert_aux(iterator __position, bool __x) {
- if (_M_finish._M_p != _M_end_of_storage) {
- copy_backward(__position, _M_finish, _M_finish + 1);
+ if (this->_M_finish._M_p != this->_M_end_of_storage) {
+ copy_backward(__position, this->_M_finish, this->_M_finish + 1);
*__position = __x;
- ++_M_finish;
+ ++this->_M_finish;
}
else {
size_type __len = size()
@@ -390,19 +390,19 @@ template <typename _Alloc>
_Bit_type * __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
*__i++ = __x;
- _M_finish = copy(__position, end(), __i);
+ this->_M_finish = copy(__position, end(), __i);
_M_deallocate();
- _M_end_of_storage = __q + (__len + _M_word_bit - 1)/_M_word_bit;
- _M_start = iterator(__q, 0);
+ this->_M_end_of_storage = __q + (__len + _M_word_bit - 1)/_M_word_bit;
+ this->_M_start = iterator(__q, 0);
}
}
template <class _InputIterator>
void _M_initialize_range(_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
- _M_start = iterator();
- _M_finish = iterator();
- _M_end_of_storage = 0;
+ this->_M_start = iterator();
+ this->_M_finish = iterator();
+ this->_M_end_of_storage = 0;
for ( ; __first != __last; ++__first)
push_back(*__first);
}
@@ -412,7 +412,7 @@ template <typename _Alloc>
forward_iterator_tag) {
size_type __n = std::distance(__first, __last);
_M_initialize(__n);
- copy(__first, __last, _M_start);
+ copy(__first, __last, this->_M_start);
}
template <class _InputIterator>
@@ -432,28 +432,30 @@ template <typename _Alloc>
if (__first != __last) {
size_type __n = std::distance(__first, __last);
if (capacity() - size() >= __n) {
- copy_backward(__position, end(), _M_finish + difference_type(__n));
+ copy_backward(__position, end(),
+ this->_M_finish + difference_type(__n));
copy(__first, __last, __position);
- _M_finish += difference_type(__n);
+ this->_M_finish += difference_type(__n);
}
else {
size_type __len = size() + std::max(size(), __n);
_Bit_type * __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
__i = copy(__first, __last, __i);
- _M_finish = copy(__position, end(), __i);
+ this->_M_finish = copy(__position, end(), __i);
_M_deallocate();
- _M_end_of_storage = __q + (__len + _M_word_bit - 1)/_M_word_bit;
- _M_start = iterator(__q, 0);
+ this->_M_end_of_storage
+ = __q + (__len + _M_word_bit - 1)/_M_word_bit;
+ this->_M_start = iterator(__q, 0);
}
}
}
public:
- iterator begin() { return _M_start; }
- const_iterator begin() const { return _M_start; }
- iterator end() { return _M_finish; }
- const_iterator end() const { return _M_finish; }
+ iterator begin() { return this->_M_start; }
+ const_iterator begin() const { return this->_M_start; }
+ iterator end() { return this->_M_finish; }
+ const_iterator end() const { return this->_M_finish; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
@@ -467,7 +469,7 @@ template <typename _Alloc>
size_type size() const { return size_type(end() - begin()); }
size_type max_size() const { return size_type(-1); }
size_type capacity() const {
- return size_type(const_iterator(_M_end_of_storage, 0) - begin());
+ return size_type(const_iterator(this->_M_end_of_storage, 0) - begin());
}
bool empty() const { return begin() == end(); }
@@ -494,19 +496,19 @@ template <typename _Alloc>
: _Bvector_base<_Alloc>(__a)
{
_M_initialize(__n);
- fill(_M_start._M_p, _M_end_of_storage, __value ? ~0 : 0);
+ fill(this->_M_start._M_p, this->_M_end_of_storage, __value ? ~0 : 0);
}
explicit vector(size_type __n)
: _Bvector_base<_Alloc>(allocator_type())
{
_M_initialize(__n);
- fill(_M_start._M_p, _M_end_of_storage, 0);
+ fill(this->_M_start._M_p, this->_M_end_of_storage, 0);
}
vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator()) {
_M_initialize(__x.size());
- copy(__x.begin(), __x.end(), _M_start);
+ copy(__x.begin(), __x.end(), this->_M_start);
}
// Check whether it's an integral type. If so, it's not an iterator.
@@ -514,7 +516,7 @@ template <typename _Alloc>
template <class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
_M_initialize(__n);
- fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
+ fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
}
template <class _InputIterator>
@@ -541,7 +543,7 @@ template <typename _Alloc>
_M_initialize(__x.size());
}
copy(__x.begin(), __x.end(), begin());
- _M_finish = begin() + difference_type(__x.size());
+ this->_M_finish = begin() + difference_type(__x.size());
return *this;
}
@@ -552,12 +554,12 @@ template <typename _Alloc>
void _M_fill_assign(size_t __n, bool __x) {
if (__n > size()) {
- fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
+ fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
insert(end(), __n - size(), __x);
}
else {
erase(begin() + __n, end());
- fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
+ fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
}
}
@@ -608,10 +610,10 @@ template <typename _Alloc>
__throw_length_error("vector::reserve");
if (this->capacity() < __n) {
_Bit_type * __q = _M_bit_alloc(__n);
- _M_finish = copy(begin(), end(), iterator(__q, 0));
+ this->_M_finish = copy(begin(), end(), iterator(__q, 0));
_M_deallocate();
- _M_start = iterator(__q, 0);
- _M_end_of_storage = __q + (__n + _M_word_bit - 1)/_M_word_bit;
+ this->_M_start = iterator(__q, 0);
+ this->_M_end_of_storage = __q + (__n + _M_word_bit - 1)/_M_word_bit;
}
}
@@ -620,15 +622,15 @@ template <typename _Alloc>
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
void push_back(bool __x) {
- if (_M_finish._M_p != _M_end_of_storage)
- *_M_finish++ = __x;
+ if (this->_M_finish._M_p != this->_M_end_of_storage)
+ *this->_M_finish++ = __x;
else
_M_insert_aux(end(), __x);
}
void swap(vector<bool, _Alloc>& __x) {
- std::swap(_M_start, __x._M_start);
- std::swap(_M_finish, __x._M_finish);
- std::swap(_M_end_of_storage, __x._M_end_of_storage);
+ std::swap(this->_M_start, __x._M_start);
+ std::swap(this->_M_finish, __x._M_finish);
+ std::swap(this->_M_end_of_storage, __x._M_end_of_storage);
}
// [23.2.5]/1, third-to-last entry in synopsis listing
@@ -640,8 +642,9 @@ template <typename _Alloc>
iterator insert(iterator __position, bool __x = bool()) {
difference_type __n = __position - begin();
- if (_M_finish._M_p != _M_end_of_storage && __position == end())
- *_M_finish++ = __x;
+ if (this->_M_finish._M_p != this->_M_end_of_storage
+ && __position == end())
+ *this->_M_finish++ = __x;
else
_M_insert_aux(__position, __x);
return begin() + __n;
@@ -672,19 +675,20 @@ template <typename _Alloc>
void _M_fill_insert(iterator __position, size_type __n, bool __x) {
if (__n == 0) return;
if (capacity() - size() >= __n) {
- copy_backward(__position, end(), _M_finish + difference_type(__n));
+ copy_backward(__position, end(),
+ this->_M_finish + difference_type(__n));
fill(__position, __position + difference_type(__n), __x);
- _M_finish += difference_type(__n);
+ this->_M_finish += difference_type(__n);
}
else {
size_type __len = size() + std::max(size(), __n);
_Bit_type * __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
fill_n(__i, __n, __x);
- _M_finish = copy(__position, end(), __i + difference_type(__n));
+ this->_M_finish = copy(__position, end(), __i + difference_type(__n));
_M_deallocate();
- _M_end_of_storage = __q + (__len + _M_word_bit - 1)/_M_word_bit;
- _M_start = iterator(__q, 0);
+ this->_M_end_of_storage = __q + (__len + _M_word_bit - 1)/_M_word_bit;
+ this->_M_start = iterator(__q, 0);
}
}
@@ -692,15 +696,15 @@ template <typename _Alloc>
_M_fill_insert(__position, __n, __x);
}
- void pop_back() { --_M_finish; }
+ void pop_back() { --this->_M_finish; }
iterator erase(iterator __position) {
if (__position + 1 != end())
copy(__position + 1, end(), __position);
- --_M_finish;
+ --this->_M_finish;
return __position;
}
iterator erase(iterator __first, iterator __last) {
- _M_finish = copy(__last, end(), __first);
+ this->_M_finish = copy(__last, end(), __first);
return __first;
}
void resize(size_type __new_size, bool __x = bool()) {
@@ -710,7 +714,9 @@ template <typename _Alloc>
insert(end(), __new_size - size(), __x);
}
void flip() {
- for (_Bit_type * __p = _M_start._M_p; __p != _M_end_of_storage; ++__p)
+ for (_Bit_type * __p = this->_M_start._M_p;
+ __p != this->_M_end_of_storage;
+ ++__p)
*__p = ~*__p;
}
OpenPOWER on IntegriCloud