$OpenBSD: patch-src_curses_strbuffer_h,v 1.1 2017/06/09 15:09:51 dcoppa Exp $

Older versions of boost::apply_visitor require a result_type member
for the visitor

Index: src/curses/strbuffer.h
--- src/curses/strbuffer.h.orig
+++ src/curses/strbuffer.h
@@ -29,6 +29,17 @@
 
 namespace NC {
 
+template <typename ResultType, typename Visitor>
+struct boost_visitor_adapter : Visitor {
+	using result_type = ResultType;
+	boost_visitor_adapter(Visitor &&v) : Visitor(std::move(v)) {}
+};
+
+template <typename ResultType = void, typename Visitor>
+auto to_boost_visitor(Visitor &&v) {
+	return boost_visitor_adapter<ResultType, Visitor>(std::move(v));
+}
+
 /// Buffer template class that stores text
 /// along with its properties (colors/formatting).
 template <typename CharT> class BasicBuffer
@@ -49,7 +60,7 @@ template <typename CharT> class BasicBuffer
 		template <typename OutputStreamT>
 		friend OutputStreamT &operator<<(OutputStreamT &os, const Property &p)
 		{
-			boost::apply_visitor([&os](const auto &v) { os << v; }, p.m_impl);
+			boost::apply_visitor(to_boost_visitor([&os](const auto &v) { os << v; }), p.m_impl);
 			return os;
 		}
 		
