diff options
| author | Tim Dwyer <tgdwyer@gmail.com> | 2006-02-22 06:31:01 +0000 |
|---|---|---|
| committer | tgdwyer <tgdwyer@users.sourceforge.net> | 2006-02-22 06:31:01 +0000 |
| commit | 8620ac708c25982b34d058ec2d8129b95262069a (patch) | |
| tree | 57f9ab59d34a8420604266d50b1d9a631d3e85ee /src | |
| parent | introduce orthogonal template declaration, fixes compiler warnings (diff) | |
| download | inkscape-8620ac708c25982b34d058ec2d8129b95262069a.tar.gz inkscape-8620ac708c25982b34d058ec2d8129b95262069a.zip | |
Fixed template warning.
(bzr r173)
Diffstat (limited to 'src')
| -rw-r--r-- | src/removeoverlap/pairingheap/PairingHeap.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/removeoverlap/pairingheap/PairingHeap.h b/src/removeoverlap/pairingheap/PairingHeap.h index f8c3abf35..52941873b 100644 --- a/src/removeoverlap/pairingheap/PairingHeap.h +++ b/src/removeoverlap/pairingheap/PairingHeap.h @@ -38,23 +38,26 @@ // 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> @@ -67,8 +70,7 @@ public: 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 ); |
