summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5201748)
raw | patch | inline | side by side (parent: 5201748)
author | tgdwyer <tgdwyer@users.sourceforge.net> | |
Wed, 22 Feb 2006 06:31:01 +0000 (06:31 +0000) | ||
committer | tgdwyer <tgdwyer@users.sourceforge.net> | |
Wed, 22 Feb 2006 06:31:01 +0000 (06:31 +0000) |
src/removeoverlap/pairingheap/PairingHeap.h | patch | blob | history |
diff --git a/src/removeoverlap/pairingheap/PairingHeap.h b/src/removeoverlap/pairingheap/PairingHeap.h
index f8c3abf3529411a7df1b9121ad58a7427e8036e2..52941873bbbcd5a9213e29880055f43e1928f349 100644 (file)
// Node and forward declaration because g++ does
// not understand nested classes.
-template <class T>
+template <class T>
class PairingHeap;
+template <class T>
+std::ostream& operator<< (std::ostream &os,const PairingHeap<T> &b);
+
template <class T>
class PairNode
{
- template <class U>
- friend std::ostream& operator <<(std::ostream &os,const PairingHeap<U> &b);
-
+ friend std::ostream& operator<< <T>(std::ostream &os,const PairingHeap<T> &b);
T element;
PairNode *leftChild;
PairNode *nextSibling;
PairNode *prev;
- PairNode( const T & theElement ) : element( theElement ),
- leftChild(NULL), nextSibling(NULL), prev(NULL) { }
- friend class PairingHeap<T>;
+ PairNode( const T & theElement ) :
+ element( theElement ),
+ leftChild(NULL), nextSibling(NULL), prev(NULL)
+ { }
+ friend class PairingHeap<T>;
};
template <class T>
template <class T>
class PairingHeap
{
- template <class U>
- friend std::ostream& operator <<(std::ostream &os,const PairingHeap<U> &b);
+ friend std::ostream& operator<< <T>(std::ostream &os,const PairingHeap<T> &b);
public:
PairingHeap( bool (*lessThan)(T const &lhs, T const &rhs) );
PairingHeap( const PairingHeap & rhs );