xo-refcnt: feat: printing for brw<T>
This commit is contained in:
parent
0c45d2b883
commit
7c59381604
1 changed files with 11 additions and 0 deletions
|
|
@ -329,6 +329,17 @@ namespace xo {
|
|||
return Borrow<T>(*this);
|
||||
} /*borrow*/
|
||||
|
||||
template<typename T>
|
||||
inline std::ostream &
|
||||
operator<<(std::ostream & os, Borrow<T> x) {
|
||||
if (x) {
|
||||
os << *x;
|
||||
} else {
|
||||
os << "<nullptr " << reflect::type_name<T>() << ">";
|
||||
}
|
||||
return os;
|
||||
} /*operator<<*/
|
||||
|
||||
} /*namespace ref*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue