From c7a030aa3755f9021381dab036804989f5be1a16 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 3 Jul 2024 15:43:43 -0400 Subject: [PATCH] xo-reflect: + Borrow::operator=() --- include/xo/refcnt/Refcounted.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/xo/refcnt/Refcounted.hpp b/include/xo/refcnt/Refcounted.hpp index da4ba539..0b62e557 100644 --- a/include/xo/refcnt/Refcounted.hpp +++ b/include/xo/refcnt/Refcounted.hpp @@ -297,8 +297,11 @@ namespace xo { return ptrdiff_t(x.get() - y.get()); } /*compare*/ - private: - Borrow(T * x) : ptr_(x) {} + template + Borrow & operator=(const Borrow & x) { + ptr_ = x.get(); + return *this; + } private: T * ptr_ = nullptr;