From 7c593816045729c8d854f4db54f3f4dd9ac8c5d1 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 6 Aug 2024 13:01:43 -0400 Subject: [PATCH] xo-refcnt: feat: printing for brw --- include/xo/refcnt/Refcounted.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/xo/refcnt/Refcounted.hpp b/include/xo/refcnt/Refcounted.hpp index a9d4386..41abf93 100644 --- a/include/xo/refcnt/Refcounted.hpp +++ b/include/xo/refcnt/Refcounted.hpp @@ -329,6 +329,17 @@ namespace xo { return Borrow(*this); } /*borrow*/ + template + inline std::ostream & + operator<<(std::ostream & os, Borrow x) { + if (x) { + os << *x; + } else { + os << "() << ">"; + } + return os; + } /*operator<<*/ + } /*namespace ref*/ } /*namespace xo*/