diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-02-19 19:30:09 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-02-19 19:30:09 +0000 |
commit | 62287ea894a1587553f017d0f6a09d4c87ad3b1f (patch) | |
tree | 154c6fbb6b3ef39c82809b6c3e3edaab8af71dbd /src/tests/heap.cpp | |
parent | e2a10c7b77b03bacf4d8b8dcf08f8f8f47628314 (diff) | |
download | libbu++-62287ea894a1587553f017d0f6a09d4c87ad3b1f.tar.gz libbu++-62287ea894a1587553f017d0f6a09d4c87ad3b1f.tar.bz2 libbu++-62287ea894a1587553f017d0f6a09d4c87ad3b1f.tar.xz libbu++-62287ea894a1587553f017d0f6a09d4c87ad3b1f.zip |
I believe this will do the trick. The Bu::Heap class now uses the appropriate
allocators for all work, every data type used in a Bu::Heap must support the
equals operator and <= or >=, or you need to write your own comparison functor.
The heap works as both a min-heap and max-heap, just change out the functor used
for camparison, kinda' cool.
The print function I'll leave in for a little while, but not in the long run, it
just prints a dot graph to stdout.
Next up, the Ito version.
Diffstat (limited to 'src/tests/heap.cpp')
-rw-r--r-- | src/tests/heap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tests/heap.cpp b/src/tests/heap.cpp index e93749f..3217715 100644 --- a/src/tests/heap.cpp +++ b/src/tests/heap.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | int main() | 6 | int main() |
7 | { | 7 | { |
8 | Bu::Heap<int> hInt; | 8 | Bu::Heap<int, Bu::__basicGTCmp<int> > hInt; |
9 | 9 | ||
10 | for( int j = 0; j < 15; j++ ) | 10 | for( int j = 0; j < 15; j++ ) |
11 | { | 11 | { |