diff --git a/include/xo/refcnt/Refcounted.hpp b/include/xo/refcnt/Refcounted.hpp index a9d4386b..41abf938 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*/