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;
