1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
Description: Fix build failure with gcc 5
Author: Sebastian Ramacher <sramacher@debian.org>
Last-Update: 2015-03-02
Bug-Debian: https://bugs.debian.org/777951
diff --git a/kdtree++/node.hpp b/kdtree++/node.hpp
index f3eece3..087717b 100644
--- a/kdtree++/node.hpp
+++ b/kdtree++/node.hpp
@@ -43,6 +43,23 @@ namespace KDTree
while (__x->_M_right) __x = __x->_M_right;
return __x;
}
+
+#ifdef KDTREE_DEFINE_OSTREAM_OPERATORS
+
+ template <typename Char, typename Traits>
+ friend
+ std::basic_ostream<Char, Traits>&
+ operator<<(typename std::basic_ostream<Char, Traits>& out,
+ _Node_base const& node)
+ {
+ out << &node;
+ out << " parent: " << node._M_parent;
+ out << "; left: " << node._M_left;
+ out << "; right: " << node._M_right;
+ return out;
+ }
+
+#endif
};
template <typename _Val>
@@ -65,19 +82,6 @@ namespace KDTree
friend
std::basic_ostream<Char, Traits>&
operator<<(typename std::basic_ostream<Char, Traits>& out,
- _Node_base const& node)
- {
- out << &node;
- out << " parent: " << node._M_parent;
- out << "; left: " << node._M_left;
- out << "; right: " << node._M_right;
- return out;
- }
-
- template <typename Char, typename Traits>
- friend
- std::basic_ostream<Char, Traits>&
- operator<<(typename std::basic_ostream<Char, Traits>& out,
_Node<_Val> const& node)
{
out << &node;
|