From b09d07bff8e0193ba6672fd48dac2bff313bdd96 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 22 Feb 2002 19:20:56 +0000 Subject: [PATCH] vc++ build farts --- panda/src/putil/ordered_vector.I | 49 ++++++++------------------------ panda/src/putil/ordered_vector.h | 13 +++++++-- 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/panda/src/putil/ordered_vector.I b/panda/src/putil/ordered_vector.I index e425c36018..34fcaa76d5 100644 --- a/panda/src/putil/ordered_vector.I +++ b/panda/src/putil/ordered_vector.I @@ -17,31 +17,6 @@ //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////// -// Function: ordered_vector::EquivalentTest::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -template -INLINE ordered_vector::EquivalentTest:: -EquivalentTest(const Compare &compare) : - _compare(compare) -{ -} - -//////////////////////////////////////////////////////////////////// -// Function: ordered_vector::EquivalentTest::operator () -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -template -INLINE bool ordered_vector::EquivalentTest:: -operator () (const ordered_vector::key_type &a, - const ordered_vector::key_type &b) { - nassertr(!_compare(b, a), false); - return !_compare(a, b); -} - //////////////////////////////////////////////////////////////////// // Function: ordered_vector::Constructor // Access: Public @@ -734,7 +709,7 @@ verify_list() { template INLINE ov_set:: ov_set(const Compare &compare) : - ordered_vector(compare) + ordered_vector(compare) { } @@ -746,7 +721,7 @@ ov_set(const Compare &compare) : template INLINE ov_set:: ov_set(const ov_set ©) : - ordered_vector(copy) + ordered_vector(copy) { } @@ -758,7 +733,7 @@ ov_set(const ov_set ©) : template INLINE ov_set &ov_set:: operator = (const ov_set ©) { - ordered_vector::operator = (copy); + ordered_vector::operator = (copy); return *this; } @@ -771,7 +746,7 @@ template ov_set::iterator ov_set:: insert(ordered_vector::iterator position, const ordered_vector::value_type &key) { - return ordered_vector::insert_unique(position, key); + return ordered_vector::insert_unique(position, key); } //////////////////////////////////////////////////////////////////// @@ -782,7 +757,7 @@ insert(ordered_vector::iterator position, template INLINE pair::iterator, bool> ov_set:: insert(const ordered_vector::value_type &key) { - return ordered_vector::insert_unique(key); + return ordered_vector::insert_unique(key); } //////////////////////////////////////////////////////////////////// @@ -793,7 +768,7 @@ insert(const ordered_vector::value_type &key) { template INLINE void ov_set:: sort() { - return ordered_vector::sort_unique(); + return ordered_vector::sort_unique(); } //////////////////////////////////////////////////////////////////// @@ -804,7 +779,7 @@ sort() { template INLINE ov_multiset:: ov_multiset(const Compare &compare) : - ordered_vector(compare) + ordered_vector(compare) { } @@ -816,7 +791,7 @@ ov_multiset(const Compare &compare) : template INLINE ov_multiset:: ov_multiset(const ov_multiset ©) : - ordered_vector(copy) + ordered_vector(copy) { } @@ -828,7 +803,7 @@ ov_multiset(const ov_multiset ©) : template INLINE ov_multiset &ov_multiset:: operator = (const ov_multiset ©) { - ordered_vector::operator = (copy); + ordered_vector::operator = (copy); return *this; } @@ -841,7 +816,7 @@ template ov_multiset::iterator ov_multiset:: insert(ordered_vector::iterator position, const ordered_vector::value_type &key) { - return ordered_vector::insert_nonunique(position, key); + return ordered_vector::insert_nonunique(position, key); } //////////////////////////////////////////////////////////////////// @@ -852,7 +827,7 @@ insert(ordered_vector::iterator position, template INLINE ov_multiset::iterator ov_multiset:: insert(const ordered_vector::value_type &key) { - return ordered_vector::insert_nonunique(key); + return ordered_vector::insert_nonunique(key); } //////////////////////////////////////////////////////////////////// @@ -863,5 +838,5 @@ insert(const ordered_vector::value_type &key) { template INLINE void ov_multiset:: sort() { - return ordered_vector::sort_nonunique(); + return ordered_vector::sort_nonunique(); } diff --git a/panda/src/putil/ordered_vector.h b/panda/src/putil/ordered_vector.h index 9dd21a476e..98827e42e2 100644 --- a/panda/src/putil/ordered_vector.h +++ b/panda/src/putil/ordered_vector.h @@ -189,8 +189,17 @@ private: // if two consecutive sorted elements are equivalent. class EquivalentTest { public: - INLINE EquivalentTest(const Compare &compare); - INLINE bool operator () (const key_type &a, const key_type &b); + // For some reason, VC++ won't allow us to define these bodies + // outside the class; they must be defined here. The error + // message is C3206: "member functions of nested classes of a + // template class cannot be defined outside the class". + INLINE EquivalentTest(const Compare &compare) : + _compare(compare) { } + INLINE bool operator () (const key_type &a, const key_type &b) { + nassertr(!_compare(b, a), false); + return !_compare(a, b); + } + Compare _compare; };