ansi fixes

This commit is contained in:
cxgeorge 2002-11-22 23:06:29 +00:00
parent bda142a078
commit c3ad80cf52
6 changed files with 167 additions and 167 deletions

View File

@ -72,7 +72,7 @@ INLINE ordered_vector<Key, Compare>::
// the ordered vector. // the ordered vector.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
begin() { begin() {
return _vector.begin(); return _vector.begin();
} }
@ -84,7 +84,7 @@ begin() {
// ordered vector. // ordered vector.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
end() { end() {
return _vector.end(); return _vector.end();
} }
@ -96,7 +96,7 @@ end() {
// the ordered vector, when viewed in reverse order. // the ordered vector, when viewed in reverse order.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::REVERSE_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::REVERSE_ITERATOR ordered_vector<Key, Compare>::
rbegin() { rbegin() {
return _vector.rbegin(); return _vector.rbegin();
} }
@ -108,7 +108,7 @@ rbegin() {
// ordered vector, when viewed in reverse order. // ordered vector, when viewed in reverse order.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::REVERSE_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::REVERSE_ITERATOR ordered_vector<Key, Compare>::
rend() { rend() {
return _vector.rend(); return _vector.rend();
} }
@ -120,7 +120,7 @@ rend() {
// the ordered vector. // the ordered vector.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
begin() const { begin() const {
return _vector.begin(); return _vector.begin();
} }
@ -132,7 +132,7 @@ begin() const {
// ordered vector. // ordered vector.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
end() const { end() const {
return _vector.end(); return _vector.end();
} }
@ -144,7 +144,7 @@ end() const {
// the ordered vector, when viewed in reverse order. // the ordered vector, when viewed in reverse order.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_REVERSE_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_REVERSE_ITERATOR ordered_vector<Key, Compare>::
rbegin() const { rbegin() const {
return _vector.rbegin(); return _vector.rbegin();
} }
@ -156,7 +156,7 @@ rbegin() const {
// ordered vector, when viewed in reverse order. // ordered vector, when viewed in reverse order.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_REVERSE_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_REVERSE_ITERATOR ordered_vector<Key, Compare>::
rend() const { rend() const {
return _vector.rend(); return _vector.rend();
} }
@ -167,8 +167,8 @@ rend() const {
// Description: Returns the nth element. // Description: Returns the nth element.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::REFERENCE ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::REFERENCE ordered_vector<Key, Compare>::
operator [] (ordered_vector<Key, Compare>::SIZE_TYPE n) { operator [] (typename ordered_vector<Key, Compare>::SIZE_TYPE n) {
return _vector[n]; return _vector[n];
} }
@ -178,8 +178,8 @@ operator [] (ordered_vector<Key, Compare>::SIZE_TYPE n) {
// Description: Returns the nth element. // Description: Returns the nth element.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_REFERENCE ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_REFERENCE ordered_vector<Key, Compare>::
operator [] (ordered_vector<Key, Compare>::SIZE_TYPE n) const { operator [] (typename ordered_vector<Key, Compare>::SIZE_TYPE n) const {
return _vector[n]; return _vector[n];
} }
@ -189,7 +189,7 @@ operator [] (ordered_vector<Key, Compare>::SIZE_TYPE n) const {
// Description: Returns the number of elements in the ordered vector. // Description: Returns the number of elements in the ordered vector.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>::
size() const { size() const {
return _vector.size(); return _vector.size();
} }
@ -201,7 +201,7 @@ size() const {
// possibly be stored in an ordered vector. // possibly be stored in an ordered vector.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>::
max_size() const { max_size() const {
return _vector.max_size(); return _vector.max_size();
} }
@ -309,8 +309,8 @@ operator >= (const ordered_vector<Key, Compare> &other) const {
// the insert operation has taken place. // the insert operation has taken place.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE pair<ordered_vector<Key, Compare>::ITERATOR, bool> ordered_vector<Key, Compare>:: INLINE typename pair<typename ordered_vector<Key, Compare>::ITERATOR, bool> ordered_vector<Key, Compare>::
insert_unique(const ordered_vector<Key, Compare>::VALUE_TYPE &key) { insert_unique(const typename ordered_vector<Key, Compare>::VALUE_TYPE &key) {
ITERATOR position = find_insert_position(begin(), end(), key); ITERATOR position = find_insert_position(begin(), end(), key);
#ifdef NDEBUG #ifdef NDEBUG
pair<ITERATOR, bool> bogus_result(end(), false); pair<ITERATOR, bool> bogus_result(end(), false);
@ -341,8 +341,8 @@ insert_unique(const ordered_vector<Key, Compare>::VALUE_TYPE &key) {
// element. // element.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
insert_nonunique(const ordered_vector<Key, Compare>::VALUE_TYPE &key) { insert_nonunique(const typename ordered_vector<Key, Compare>::VALUE_TYPE &key) {
ITERATOR position = find_insert_position(begin(), end(), key); ITERATOR position = find_insert_position(begin(), end(), key);
nassertr(position >= begin() && position <= end(), end()); nassertr(position >= begin() && position <= end(), end());
@ -358,8 +358,8 @@ insert_nonunique(const ordered_vector<Key, Compare>::VALUE_TYPE &key) {
// and returns the next sequential iterator. // and returns the next sequential iterator.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
erase(ordered_vector<Key, Compare>::ITERATOR position) { erase(typename ordered_vector<Key, Compare>::ITERATOR position) {
SIZE_TYPE count = position - begin(); SIZE_TYPE count = position - begin();
_vector.erase(position); _vector.erase(position);
return begin() + count; return begin() + count;
@ -372,8 +372,8 @@ erase(ordered_vector<Key, Compare>::ITERATOR position) {
// returns the number of elements removed. // returns the number of elements removed.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>::
erase(const ordered_vector<Key, Compare>::KEY_TYPE &key) { erase(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
pair<ITERATOR, ITERATOR> result = equal_range(key); pair<ITERATOR, ITERATOR> result = equal_range(key);
SIZE_TYPE count = result.second - result.first; SIZE_TYPE count = result.second - result.first;
erase(result.first, result.second); erase(result.first, result.second);
@ -388,8 +388,8 @@ erase(const ordered_vector<Key, Compare>::KEY_TYPE &key) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE void ordered_vector<Key, Compare>:: INLINE void ordered_vector<Key, Compare>::
erase(ordered_vector<Key, Compare>::ITERATOR first, erase(typename ordered_vector<Key, Compare>::ITERATOR first,
ordered_vector<Key, Compare>::ITERATOR last) { typename ordered_vector<Key, Compare>::ITERATOR last) {
_vector.erase(first, last); _vector.erase(first, last);
} }
@ -413,8 +413,8 @@ clear() {
// key, the particular iterator returned is not defined. // key, the particular iterator returned is not defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
find(const ordered_vector<Key, Compare>::KEY_TYPE &key) { find(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
return nci(r_find(begin(), end(), end(), key)); return nci(r_find(begin(), end(), end(), key));
} }
@ -427,8 +427,8 @@ find(const ordered_vector<Key, Compare>::KEY_TYPE &key) {
// key, the particular iterator returned is not defined. // key, the particular iterator returned is not defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
find(const ordered_vector<Key, Compare>::KEY_TYPE &key) const { find(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
return r_find(begin(), end(), end(), key); return r_find(begin(), end(), end(), key);
} }
@ -449,8 +449,8 @@ find(const ordered_vector<Key, Compare>::KEY_TYPE &key) const {
// !Compare(b, a), but not necessarily the converse. // !Compare(b, a), but not necessarily the converse.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
find_particular(const ordered_vector<Key, Compare>::KEY_TYPE &key) { find_particular(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
return nci(r_find_particular(begin(), end(), end(), key)); return nci(r_find_particular(begin(), end(), end(), key));
} }
@ -468,8 +468,8 @@ find_particular(const ordered_vector<Key, Compare>::KEY_TYPE &key) {
// particular iterator returned is not defined./ // particular iterator returned is not defined./
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
find_particular(const ordered_vector<Key, Compare>::KEY_TYPE &key) const { find_particular(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
return r_find_particular(begin(), end(), end(), key); return r_find_particular(begin(), end(), end(), key);
} }
@ -480,7 +480,7 @@ find_particular(const ordered_vector<Key, Compare>::KEY_TYPE &key) const {
// to the key that are in the vector. // to the key that are in the vector.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>::
count(const key_type &key) const { count(const key_type &key) const {
return r_count(begin(), end(), key); return r_count(begin(), end(), key);
} }
@ -492,8 +492,8 @@ count(const key_type &key) const {
// than key, or end() if all elements are less than key. // than key, or end() if all elements are less than key.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
lower_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) { lower_bound(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
return nci(r_lower_bound(begin(), end(), key)); return nci(r_lower_bound(begin(), end(), key));
} }
@ -504,8 +504,8 @@ lower_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) {
// than key, or end() if all elements are less than key. // than key, or end() if all elements are less than key.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
lower_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) const { lower_bound(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
return r_lower_bound(begin(), end(), key); return r_lower_bound(begin(), end(), key);
} }
@ -517,8 +517,8 @@ lower_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) const {
// key. // key.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
upper_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) { upper_bound(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
return nci(r_upper_bound(begin(), end(), key)); return nci(r_upper_bound(begin(), end(), key));
} }
@ -530,8 +530,8 @@ upper_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) {
// key. // key.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
upper_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) const { upper_bound(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
return r_upper_bound(begin(), end(), key); return r_upper_bound(begin(), end(), key);
} }
@ -541,11 +541,11 @@ upper_bound(const ordered_vector<Key, Compare>::KEY_TYPE &key) const {
// Description: Returns the pair (lower_bound(key), upper_bound(key)). // Description: Returns the pair (lower_bound(key), upper_bound(key)).
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE pair<ordered_vector<Key, Compare>::ITERATOR, ordered_vector<Key, Compare>::ITERATOR> ordered_vector<Key, Compare>:: INLINE pair<typename ordered_vector<Key, Compare>::ITERATOR, typename ordered_vector<Key, Compare>::ITERATOR> ordered_vector<Key, Compare>::
equal_range(const ordered_vector<Key, Compare>::KEY_TYPE &key) { equal_range(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
pair<ordered_vector<Key, Compare>::CONST_ITERATOR, ordered_vector<Key, Compare>::CONST_ITERATOR> result; pair<typename ordered_vector<Key, Compare>::CONST_ITERATOR, typename ordered_vector<Key, Compare>::CONST_ITERATOR> result;
result = r_equal_range(begin(), end(), key); result = r_equal_range(begin(), end(), key);
return pair<ordered_vector<Key, Compare>::ITERATOR, ordered_vector<Key, Compare>::ITERATOR>(nci(result.first), nci(result.second)); return pair<typename ordered_vector<Key, Compare>::ITERATOR, typename ordered_vector<Key, Compare>::ITERATOR>(nci(result.first), nci(result.second));
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -554,8 +554,8 @@ equal_range(const ordered_vector<Key, Compare>::KEY_TYPE &key) {
// Description: Returns the pair (lower_bound(key), upper_bound(key)). // Description: Returns the pair (lower_bound(key), upper_bound(key)).
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE pair<ordered_vector<Key, Compare>::CONST_ITERATOR, ordered_vector<Key, Compare>::CONST_ITERATOR> ordered_vector<Key, Compare>:: INLINE pair<typename ordered_vector<Key, Compare>::CONST_ITERATOR, typename ordered_vector<Key, Compare>::CONST_ITERATOR> ordered_vector<Key, Compare>::
equal_range(const ordered_vector<Key, Compare>::KEY_TYPE &key) const { equal_range(const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
return r_equal_range(begin(), end(), key); return r_equal_range(begin(), end(), key);
} }
@ -580,7 +580,7 @@ swap(ordered_vector<Key, Compare> &copy) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE void ordered_vector<Key, Compare>:: INLINE void ordered_vector<Key, Compare>::
reserve(ordered_vector<Key, Compare>::SIZE_TYPE n) { reserve(typename ordered_vector<Key, Compare>::SIZE_TYPE n) {
_vector.reserve(n); _vector.reserve(n);
} }
@ -642,8 +642,8 @@ push_back(const value_type &key) {
// some of these methods. // some of these methods.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
nci(ordered_vector<Key, Compare>::CONST_ITERATOR i) { nci(typename ordered_vector<Key, Compare>::CONST_ITERATOR i) {
return begin() + (i - begin()); return begin() + (i - begin());
} }
@ -655,10 +655,10 @@ nci(ordered_vector<Key, Compare>::CONST_ITERATOR i) {
// corresponding iterator. // corresponding iterator.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: INLINE typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
find_insert_position(ordered_vector<Key, Compare>::ITERATOR first, find_insert_position(typename ordered_vector<Key, Compare>::ITERATOR first,
ordered_vector<Key, Compare>::ITERATOR last, typename ordered_vector<Key, Compare>::ITERATOR last,
const ordered_vector<Key, Compare>::KEY_TYPE &key) { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
ITERATOR result = r_find_insert_position(first, last, key); ITERATOR result = r_find_insert_position(first, last, key);
return result; return result;
} }
@ -705,9 +705,9 @@ operator = (const ov_set<Key, Compare> &copy) {
// Description: Maps to insert_unique(). // Description: Maps to insert_unique().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ov_set<Key, Compare>::ITERATOR ov_set<Key, Compare>:: typename ov_set<Key, Compare>::ITERATOR ov_set<Key, Compare>::
insert(ov_set<Key, Compare>::ITERATOR position, insert(typename ov_set<Key, Compare>::ITERATOR position,
const ov_set<Key, Compare>::VALUE_TYPE &key) { const typename ov_set<Key, Compare>::VALUE_TYPE &key) {
return ordered_vector<Key, Compare>::insert_unique(position, key); return ordered_vector<Key, Compare>::insert_unique(position, key);
} }
@ -717,8 +717,8 @@ insert(ov_set<Key, Compare>::ITERATOR position,
// Description: Maps to insert_unique(). // Description: Maps to insert_unique().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE pair<ov_set<Key, Compare>::ITERATOR, bool> ov_set<Key, Compare>:: INLINE pair<typename ov_set<Key, Compare>::ITERATOR, bool> ov_set<Key, Compare>::
insert(const ov_set<Key, Compare>::VALUE_TYPE &key) { insert(const typename ov_set<Key, Compare>::VALUE_TYPE &key) {
return ordered_vector<Key, Compare>::insert_unique(key); return ordered_vector<Key, Compare>::insert_unique(key);
} }
@ -786,9 +786,9 @@ operator = (const ov_multiset<Key, Compare> &copy) {
// Description: Maps to insert_nonunique(). // Description: Maps to insert_nonunique().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ov_multiset<Key, Compare>::ITERATOR ov_multiset<Key, Compare>:: typename ov_multiset<Key, Compare>::ITERATOR ov_multiset<Key, Compare>::
insert(ov_multiset<Key, Compare>::ITERATOR position, insert(typename ov_multiset<Key, Compare>::ITERATOR position,
const ov_multiset<Key, Compare>::VALUE_TYPE &key) { const typename ov_multiset<Key, Compare>::VALUE_TYPE &key) {
return ordered_vector<Key, Compare>::insert_nonunique(position, key); return ordered_vector<Key, Compare>::insert_nonunique(position, key);
} }
@ -798,8 +798,8 @@ insert(ov_multiset<Key, Compare>::ITERATOR position,
// Description: Maps to insert_nonunique(). // Description: Maps to insert_nonunique().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
INLINE ov_multiset<Key, Compare>::ITERATOR ov_multiset<Key, Compare>:: INLINE typename ov_multiset<Key, Compare>::ITERATOR ov_multiset<Key, Compare>::
insert(const ov_multiset<Key, Compare>::VALUE_TYPE &key) { insert(const typename ov_multiset<Key, Compare>::VALUE_TYPE &key) {
return ordered_vector<Key, Compare>::insert_nonunique(key); return ordered_vector<Key, Compare>::insert_nonunique(key);
} }

View File

@ -32,9 +32,9 @@
// referencing the original value is returned. // referencing the original value is returned.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
insert_unique(ordered_vector<Key, Compare>::ITERATOR position, insert_unique(typename ordered_vector<Key, Compare>::ITERATOR position,
const ordered_vector<Key, Compare>::VALUE_TYPE &key) { const typename ordered_vector<Key, Compare>::VALUE_TYPE &key) {
if (position != end()) { if (position != end()) {
// If we're not inserting at the end, the element we're // If we're not inserting at the end, the element we're
// inserting before should not lexicographically precede this one. // inserting before should not lexicographically precede this one.
@ -78,9 +78,9 @@ insert_unique(ordered_vector<Key, Compare>::ITERATOR position,
// same key to be inserted. // same key to be inserted.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
insert_nonunique(ordered_vector<Key, Compare>::ITERATOR position, insert_nonunique(typename ordered_vector<Key, Compare>::ITERATOR position,
const ordered_vector<Key, Compare>::VALUE_TYPE &key) { const typename ordered_vector<Key, Compare>::VALUE_TYPE &key) {
if (position != end()) { if (position != end()) {
// If we're not inserting at the end, the element we're // If we're not inserting at the end, the element we're
// inserting before should not lexicographically precede this one. // inserting before should not lexicographically precede this one.
@ -162,10 +162,10 @@ verify_list_nonunique() const {
// find_insert_position(). // find_insert_position().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::ITERATOR ordered_vector<Key, Compare>::
r_find_insert_position(ordered_vector<Key, Compare>::ITERATOR first, r_find_insert_position(typename ordered_vector<Key, Compare>::ITERATOR first,
ordered_vector<Key, Compare>::ITERATOR last, typename ordered_vector<Key, Compare>::ITERATOR last,
const ordered_vector<Key, Compare>::KEY_TYPE &key) { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) {
if (first == last) { if (first == last) {
// The list is empty; the insert position is the last of the list. // The list is empty; the insert position is the last of the list.
return last; return last;
@ -190,11 +190,11 @@ r_find_insert_position(ordered_vector<Key, Compare>::ITERATOR first,
// Description: The recursive implementation of find(). // Description: The recursive implementation of find().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
r_find(ordered_vector<Key, Compare>::CONST_ITERATOR first, r_find(typename ordered_vector<Key, Compare>::CONST_ITERATOR first,
ordered_vector<Key, Compare>::CONST_ITERATOR last, typename ordered_vector<Key, Compare>::CONST_ITERATOR last,
ordered_vector<Key, Compare>::CONST_ITERATOR not_found, typename ordered_vector<Key, Compare>::CONST_ITERATOR not_found,
const ordered_vector<Key, Compare>::KEY_TYPE &key) const { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
if (first == last) { if (first == last) {
// The list is empty; the key is not on the list. // The list is empty; the key is not on the list.
return not_found; return not_found;
@ -223,11 +223,11 @@ r_find(ordered_vector<Key, Compare>::CONST_ITERATOR first,
// Description: The recursive implementation of find_particular(). // Description: The recursive implementation of find_particular().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
r_find_particular(ordered_vector<Key, Compare>::CONST_ITERATOR first, r_find_particular(typename ordered_vector<Key, Compare>::CONST_ITERATOR first,
ordered_vector<Key, Compare>::CONST_ITERATOR last, typename ordered_vector<Key, Compare>::CONST_ITERATOR last,
ordered_vector<Key, Compare>::CONST_ITERATOR not_found, typename ordered_vector<Key, Compare>::CONST_ITERATOR not_found,
const ordered_vector<Key, Compare>::KEY_TYPE &key) const { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
if (first == last) { if (first == last) {
// The list is empty; the key is not on the list. // The list is empty; the key is not on the list.
return not_found; return not_found;
@ -276,11 +276,11 @@ r_find_particular(ordered_vector<Key, Compare>::CONST_ITERATOR first,
// Description: The recursive implementation of count(). // Description: The recursive implementation of count().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::SIZE_TYPE ordered_vector<Key, Compare>::
r_count(ordered_vector<Key, Compare>::CONST_ITERATOR first, r_count(typename ordered_vector<Key, Compare>::CONST_ITERATOR first,
ordered_vector<Key, Compare>::CONST_ITERATOR last, typename ordered_vector<Key, Compare>::CONST_ITERATOR last,
const ordered_vector<Key, Compare>::KEY_TYPE &key) const { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
typedef pair<ordered_vector<Key, Compare>::CONST_ITERATOR, ordered_vector<Key, Compare>::CONST_ITERATOR> pair_type; typedef pair<typename ordered_vector<Key, Compare>::CONST_ITERATOR, typename ordered_vector<Key, Compare>::CONST_ITERATOR> pair_type;
if (first == last) { if (first == last) {
// The list is empty; the key is not on the list. // The list is empty; the key is not on the list.
@ -312,10 +312,10 @@ r_count(ordered_vector<Key, Compare>::CONST_ITERATOR first,
// Description: The recursive implementation of lower_bound(). // Description: The recursive implementation of lower_bound().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
r_lower_bound(ordered_vector<Key, Compare>::CONST_ITERATOR first, r_lower_bound(typename ordered_vector<Key, Compare>::CONST_ITERATOR first,
ordered_vector<Key, Compare>::CONST_ITERATOR last, typename ordered_vector<Key, Compare>::CONST_ITERATOR last,
const ordered_vector<Key, Compare>::KEY_TYPE &key) const { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
if (first == last) { if (first == last) {
// The list is empty; the key is not on the list. // The list is empty; the key is not on the list.
return last; return last;
@ -345,10 +345,10 @@ r_lower_bound(ordered_vector<Key, Compare>::CONST_ITERATOR first,
// Description: The recursive implementation of upper_bound(). // Description: The recursive implementation of upper_bound().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>:: typename ordered_vector<Key, Compare>::CONST_ITERATOR ordered_vector<Key, Compare>::
r_upper_bound(ordered_vector<Key, Compare>::CONST_ITERATOR first, r_upper_bound(typename ordered_vector<Key, Compare>::CONST_ITERATOR first,
ordered_vector<Key, Compare>::CONST_ITERATOR last, typename ordered_vector<Key, Compare>::CONST_ITERATOR last,
const ordered_vector<Key, Compare>::KEY_TYPE &key) const { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
if (first == last) { if (first == last) {
// The list is empty; the key is not on the list. // The list is empty; the key is not on the list.
return last; return last;
@ -378,11 +378,11 @@ r_upper_bound(ordered_vector<Key, Compare>::CONST_ITERATOR first,
// Description: The recursive implementation of equal_range(). // Description: The recursive implementation of equal_range().
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Compare> template<class Key, class Compare>
pair<ordered_vector<Key, Compare>::CONST_ITERATOR, ordered_vector<Key, Compare>::CONST_ITERATOR> ordered_vector<Key, Compare>:: pair<typename ordered_vector<Key, Compare>::CONST_ITERATOR, typename ordered_vector<Key, Compare>::CONST_ITERATOR> ordered_vector<Key, Compare>::
r_equal_range(ordered_vector<Key, Compare>::CONST_ITERATOR first, r_equal_range(typename ordered_vector<Key, Compare>::CONST_ITERATOR first,
ordered_vector<Key, Compare>::CONST_ITERATOR last, typename ordered_vector<Key, Compare>::CONST_ITERATOR last,
const ordered_vector<Key, Compare>::KEY_TYPE &key) const { const typename ordered_vector<Key, Compare>::KEY_TYPE &key) const {
typedef pair<ordered_vector<Key, Compare>::CONST_ITERATOR, ordered_vector<Key, Compare>::CONST_ITERATOR> pair_type; typedef pair<typename ordered_vector<Key, Compare>::CONST_ITERATOR, typename ordered_vector<Key, Compare>::CONST_ITERATOR> pair_type;
if (first == last) { if (first == last) {
// The list is empty; the key is not on the list. // The list is empty; the key is not on the list.

View File

@ -105,13 +105,13 @@ public:
// Be careful when using the non-const iterators that you do not // Be careful when using the non-const iterators that you do not
// disturb the sorted order of the vector, or that if you do, you // disturb the sorted order of the vector, or that if you do, you
// call sort() when you are done. // call sort() when you are done.
typedef Vector::iterator ITERATOR; typedef typename Vector::iterator ITERATOR;
typedef Vector::const_iterator CONST_ITERATOR; typedef typename Vector::const_iterator CONST_ITERATOR;
typedef Vector::reverse_iterator REVERSE_ITERATOR; typedef typename Vector::reverse_iterator REVERSE_ITERATOR;
typedef Vector::const_reverse_iterator CONST_REVERSE_ITERATOR; typedef typename Vector::const_reverse_iterator CONST_REVERSE_ITERATOR;
typedef Vector::difference_type DIFFERENCE_TYPE; typedef typename Vector::difference_type DIFFERENCE_TYPE;
typedef Vector::size_type SIZE_TYPE; typedef typename Vector::size_type SIZE_TYPE;
// Since the #define symbols do not actually expand to the correct // Since the #define symbols do not actually expand to the correct
// names, we have to re-typedef them so callers can reference them // names, we have to re-typedef them so callers can reference them
@ -255,8 +255,8 @@ private:
template<class Key, class Compare = less<Key> > template<class Key, class Compare = less<Key> >
class ov_set : public ordered_vector<Key, Compare> { class ov_set : public ordered_vector<Key, Compare> {
public: public:
typedef ordered_vector<Key, Compare>::ITERATOR ITERATOR; typedef typename ordered_vector<Key, Compare>::ITERATOR ITERATOR;
typedef ordered_vector<Key, Compare>::VALUE_TYPE VALUE_TYPE; typedef typename ordered_vector<Key, Compare>::VALUE_TYPE VALUE_TYPE;
INLINE ov_set(const Compare &compare = Compare()); INLINE ov_set(const Compare &compare = Compare());
INLINE ov_set(const ov_set<Key, Compare> &copy); INLINE ov_set(const ov_set<Key, Compare> &copy);
@ -278,8 +278,8 @@ public:
template<class Key, class Compare = less<Key> > template<class Key, class Compare = less<Key> >
class ov_multiset : public ordered_vector<Key, Compare> { class ov_multiset : public ordered_vector<Key, Compare> {
public: public:
typedef ordered_vector<Key, Compare>::ITERATOR ITERATOR; typedef typename ordered_vector<Key, Compare>::ITERATOR ITERATOR;
typedef ordered_vector<Key, Compare>::VALUE_TYPE VALUE_TYPE; typedef typename ordered_vector<Key, Compare>::VALUE_TYPE VALUE_TYPE;
INLINE ov_multiset(const Compare &compare = Compare()); INLINE ov_multiset(const Compare &compare = Compare());
INLINE ov_multiset(const ov_multiset<Key, Compare> &copy); INLINE ov_multiset(const ov_multiset<Key, Compare> &copy);

View File

@ -315,7 +315,7 @@ PointerTo(const PointerTo<T> &copy) :
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE PointerTo<T>::To &PointerTo<T>:: INLINE typename PointerTo<T>::To &PointerTo<T>::
operator *() const { operator *() const {
return *_ptr; return *_ptr;
} }
@ -326,7 +326,7 @@ operator *() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE PointerTo<T>::To *PointerTo<T>:: INLINE typename PointerTo<T>::To *PointerTo<T>::
operator -> () const { operator -> () const {
return _ptr; return _ptr;
} }
@ -343,7 +343,7 @@ operator -> () const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE PointerTo<T>:: INLINE PointerTo<T>::
operator PointerToBase<T>::To *() const { operator typename PointerToBase<T>::To *() const {
return _ptr; return _ptr;
} }
@ -355,7 +355,7 @@ operator PointerToBase<T>::To *() const {
// for implicit upcasts. // for implicit upcasts.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE PointerTo<T>::To *PointerTo<T>:: INLINE typename PointerTo<T>::To *PointerTo<T>::
p() const { p() const {
return _ptr; return _ptr;
} }
@ -366,7 +366,7 @@ p() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE PointerTo<T> &PointerTo<T>:: INLINE typename PointerTo<T> &PointerTo<T>::
operator = (To *ptr) { operator = (To *ptr) {
reassign(ptr); reassign(ptr);
return *this; return *this;
@ -378,7 +378,7 @@ operator = (To *ptr) {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE PointerTo<T> &PointerTo<T>:: INLINE typename PointerTo<T> &PointerTo<T>::
operator = (const PointerTo<T> &copy) { operator = (const PointerTo<T> &copy) {
reassign((const PointerToBase<T> &)copy); reassign((const PointerToBase<T> &)copy);
return *this; return *this;
@ -426,7 +426,7 @@ ConstPointerTo(const ConstPointerTo<T> &copy) :
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE const ConstPointerTo<T>::To &ConstPointerTo<T>:: INLINE const typename ConstPointerTo<T>::To &ConstPointerTo<T>::
operator *() const { operator *() const {
return *_ptr; return *_ptr;
} }
@ -437,7 +437,7 @@ operator *() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE const ConstPointerTo<T>::To *ConstPointerTo<T>:: INLINE const typename ConstPointerTo<T>::To *ConstPointerTo<T>::
operator -> () const { operator -> () const {
return _ptr; return _ptr;
} }
@ -453,8 +453,8 @@ operator -> () const {
// correct. // correct.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE ConstPointerTo<T>:: INLINE typename ConstPointerTo<T>::
operator const PointerToBase<T>::To *() const { operator const typename PointerToBase<T>::To *() const {
return _ptr; return _ptr;
} }
@ -466,7 +466,7 @@ operator const PointerToBase<T>::To *() const {
// for implicit upcasts. // for implicit upcasts.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class T> template<class T>
INLINE const ConstPointerTo<T>::To *ConstPointerTo<T>:: INLINE const typename ConstPointerTo<T>::To *ConstPointerTo<T>::
p() const { p() const {
return _ptr; return _ptr;
} }

View File

@ -75,7 +75,7 @@ PointerToArray(const PointerToArray<Element> &copy) :
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::iterator PointerToArray<Element>:: INLINE typename PointerToArray<Element>::iterator PointerToArray<Element>::
begin() const { begin() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.begin(); return _empty_array.begin();
@ -89,7 +89,7 @@ begin() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::iterator PointerToArray<Element>:: INLINE typename PointerToArray<Element>::iterator PointerToArray<Element>::
end() const { end() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.begin(); return _empty_array.begin();
@ -103,7 +103,7 @@ end() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::reverse_iterator PointerToArray<Element>:: INLINE typename PointerToArray<Element>::reverse_iterator PointerToArray<Element>::
rbegin() const { rbegin() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.rbegin(); return _empty_array.rbegin();
@ -117,7 +117,7 @@ rbegin() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::reverse_iterator PointerToArray<Element>:: INLINE typename PointerToArray<Element>::reverse_iterator PointerToArray<Element>::
rend() const { rend() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.rbegin(); return _empty_array.rbegin();
@ -131,7 +131,7 @@ rend() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::size_type PointerToArray<Element>:: INLINE typename PointerToArray<Element>::size_type PointerToArray<Element>::
size() const { size() const {
return (_ptr == NULL) ? 0 : _ptr->size(); return (_ptr == NULL) ? 0 : _ptr->size();
} }
@ -142,7 +142,7 @@ size() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::size_type PointerToArray<Element>:: INLINE typename PointerToArray<Element>::size_type PointerToArray<Element>::
max_size() const { max_size() const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
@ -168,7 +168,7 @@ empty() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE void PointerToArray<Element>:: INLINE void PointerToArray<Element>::
reserve(PointerToArray<Element>::size_type n) { reserve(typename PointerToArray<Element>::size_type n) {
if (_ptr == NULL) { if (_ptr == NULL) {
reassign(new RefCountObj<pvector<Element> >); reassign(new RefCountObj<pvector<Element> >);
} }
@ -181,7 +181,7 @@ reserve(PointerToArray<Element>::size_type n) {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::size_type PointerToArray<Element>:: INLINE typename PointerToArray<Element>::size_type PointerToArray<Element>::
capacity() const { capacity() const {
nassertr(_ptr != NULL, 0); nassertr(_ptr != NULL, 0);
return _ptr->capacity(); return _ptr->capacity();
@ -193,7 +193,7 @@ capacity() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::reference PointerToArray<Element>:: INLINE typename PointerToArray<Element>::reference PointerToArray<Element>::
front() const { front() const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
@ -210,7 +210,7 @@ front() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::reference PointerToArray<Element>:: INLINE typename PointerToArray<Element>::reference PointerToArray<Element>::
back() const { back() const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((PointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
@ -227,7 +227,7 @@ back() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE PointerToArray<Element>::iterator PointerToArray<Element>:: INLINE typename PointerToArray<Element>::iterator PointerToArray<Element>::
insert(iterator position, const Element &x) const { insert(iterator position, const Element &x) const {
nassertr(_ptr != NULL, position); nassertr(_ptr != NULL, position);
nassertr(position >= _ptr->begin() && nassertr(position >= _ptr->begin() &&
@ -506,7 +506,7 @@ ConstPointerToArray(const ConstPointerToArray<Element> &copy) :
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::iterator ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::iterator ConstPointerToArray<Element>::
begin() const { begin() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.begin(); return _empty_array.begin();
@ -520,7 +520,7 @@ begin() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::iterator ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::iterator ConstPointerToArray<Element>::
end() const { end() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.begin(); return _empty_array.begin();
@ -534,7 +534,7 @@ end() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::reverse_iterator ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::reverse_iterator ConstPointerToArray<Element>::
rbegin() const { rbegin() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.rbegin(); return _empty_array.rbegin();
@ -548,7 +548,7 @@ rbegin() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::reverse_iterator ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::reverse_iterator ConstPointerToArray<Element>::
rend() const { rend() const {
if (_ptr == NULL) { if (_ptr == NULL) {
return _empty_array.rbegin(); return _empty_array.rbegin();
@ -562,7 +562,7 @@ rend() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>::
size() const { size() const {
return (_ptr == NULL) ? 0 : _ptr->size(); return (_ptr == NULL) ? 0 : _ptr->size();
} }
@ -573,7 +573,7 @@ size() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>::
max_size() const { max_size() const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
@ -598,7 +598,7 @@ empty() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::size_type ConstPointerToArray<Element>::
capacity() const { capacity() const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
@ -613,7 +613,7 @@ capacity() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::reference ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::reference ConstPointerToArray<Element>::
operator[](size_type n) const { operator[](size_type n) const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
@ -632,7 +632,7 @@ operator[](size_type n) const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::reference ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::reference ConstPointerToArray<Element>::
front() const { front() const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);
@ -649,7 +649,7 @@ front() const {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Element> template<class Element>
INLINE ConstPointerToArray<Element>::reference ConstPointerToArray<Element>:: INLINE typename ConstPointerToArray<Element>::reference ConstPointerToArray<Element>::
back() const { back() const {
nassertd(_ptr != NULL) { nassertd(_ptr != NULL) {
((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >); ((ConstPointerToArray<Element> *)this)->reassign(new RefCountObj<pvector<Element> >);

View File

@ -91,15 +91,15 @@
template <class Element> template <class Element>
class PointerToArray : public PointerToBase<RefCountObj<pvector<Element> > > { class PointerToArray : public PointerToBase<RefCountObj<pvector<Element> > > {
public: public:
typedef pvector<Element>::value_type value_type; typedef typename pvector<Element>::value_type value_type;
typedef pvector<Element>::reference reference; typedef typename pvector<Element>::reference reference;
typedef pvector<Element>::const_reference const_reference; typedef typename pvector<Element>::const_reference const_reference;
typedef pvector<Element>::iterator iterator; typedef typename pvector<Element>::iterator iterator;
typedef pvector<Element>::const_iterator const_iterator; typedef typename pvector<Element>::const_iterator const_iterator;
typedef pvector<Element>::reverse_iterator reverse_iterator; typedef typename pvector<Element>::reverse_iterator reverse_iterator;
typedef pvector<Element>::const_reverse_iterator const_reverse_iterator; typedef typename pvector<Element>::const_reverse_iterator const_reverse_iterator;
typedef pvector<Element>::difference_type difference_type; typedef typename pvector<Element>::difference_type difference_type;
typedef pvector<Element>::size_type size_type; typedef typename pvector<Element>::size_type size_type;
PUBLISHED: PUBLISHED:
INLINE PointerToArray(); INLINE PointerToArray();
@ -116,8 +116,8 @@ public:
INLINE iterator begin() const; INLINE iterator begin() const;
INLINE iterator end() const; INLINE iterator end() const;
INLINE PointerToArray<Element>::reverse_iterator rbegin() const; INLINE typename PointerToArray<Element>::reverse_iterator rbegin() const;
INLINE PointerToArray<Element>::reverse_iterator rend() const; INLINE typename PointerToArray<Element>::reverse_iterator rend() const;
// Equality and comparison operators are pointerwise for // Equality and comparison operators are pointerwise for
// PointerToArrays, not elementwise as in vector. // PointerToArrays, not elementwise as in vector.
@ -196,20 +196,20 @@ private:
template <class Element> template <class Element>
class ConstPointerToArray : public PointerToBase<RefCountObj<pvector<Element> > > { class ConstPointerToArray : public PointerToBase<RefCountObj<pvector<Element> > > {
public: public:
typedef pvector<Element>::value_type value_type; typedef typename pvector<Element>::value_type value_type;
typedef pvector<Element>::const_reference reference; typedef typename pvector<Element>::const_reference reference;
typedef pvector<Element>::const_reference const_reference; typedef typename pvector<Element>::const_reference const_reference;
typedef pvector<Element>::const_iterator iterator; typedef typename pvector<Element>::const_iterator iterator;
typedef pvector<Element>::const_iterator const_iterator; typedef typename pvector<Element>::const_iterator const_iterator;
#ifdef WIN32_VC #ifdef WIN32_VC
// VC++ seems to break the const_reverse_iterator definition somehow. // VC++ seems to break the const_reverse_iterator definition somehow.
typedef pvector<Element>::reverse_iterator reverse_iterator; typedef typename pvector<Element>::reverse_iterator reverse_iterator;
#else #else
typedef pvector<Element>::const_reverse_iterator reverse_iterator; typedef typename pvector<Element>::const_reverse_iterator reverse_iterator;
#endif #endif
typedef pvector<Element>::const_reverse_iterator const_reverse_iterator; typedef typename pvector<Element>::const_reverse_iterator const_reverse_iterator;
typedef pvector<Element>::difference_type difference_type; typedef typename pvector<Element>::difference_type difference_type;
typedef pvector<Element>::size_type size_type; typedef typename pvector<Element>::size_type size_type;
INLINE ConstPointerToArray(); INLINE ConstPointerToArray();
INLINE ConstPointerToArray(const PointerToArray<Element> &copy); INLINE ConstPointerToArray(const PointerToArray<Element> &copy);
@ -219,8 +219,8 @@ public:
INLINE iterator begin() const; INLINE iterator begin() const;
INLINE iterator end() const; INLINE iterator end() const;
INLINE ConstPointerToArray<Element>::reverse_iterator rbegin() const; INLINE typename ConstPointerToArray<Element>::reverse_iterator rbegin() const;
INLINE ConstPointerToArray<Element>::reverse_iterator rend() const; INLINE typename ConstPointerToArray<Element>::reverse_iterator rend() const;
// Equality and comparison operators are pointerwise for // Equality and comparison operators are pointerwise for
// PointerToArrays, not elementwise as in vector. // PointerToArrays, not elementwise as in vector.