xo-refcnt: naked pointer -> Borrow ctor

This commit is contained in:
Roland Conybeare 2024-06-24 23:57:57 -04:00
commit c7b37d35bb
2 changed files with 5 additions and 2 deletions

View file

@ -28,7 +28,7 @@ $ xo-build --clone xo-refcnt
or equivalently
```
$ git clone git@github.com:rconybea/refcnt.git xo-refcnt
$ git clone git@github.com:Rconybea/refcnt.git xo-refcnt
```
### build + install

View file

@ -257,9 +257,12 @@ namespace xo {
template<typename T>
class Borrow {
public:
template<typename S>
template <typename S>
Borrow(rp<S> const & x) : ptr_(x.get()) {}
template <typename S>
Borrow(S * x) : ptr_(x) {}
Borrow(Borrow const & x) = default;
/* convert from another borrow, if it has compatible pointer type */