Commit b55986ff authored by Dominik Charousset's avatar Dominik Charousset

Add conversion from nullptr for intrusive/cow ptr

parent ba12dd6c
...@@ -78,6 +78,10 @@ public: ...@@ -78,6 +78,10 @@ public:
intrusive_cow_ptr(const intrusive_cow_ptr&) noexcept = default; intrusive_cow_ptr(const intrusive_cow_ptr&) noexcept = default;
intrusive_cow_ptr(std::nullptr_t) noexcept {
// nop
}
template <class Y> template <class Y>
intrusive_cow_ptr(intrusive_cow_ptr<Y> other) noexcept intrusive_cow_ptr(intrusive_cow_ptr<Y> other) noexcept
: ptr_(other.detach(), false) { : ptr_(other.detach(), false) {
......
...@@ -64,6 +64,10 @@ public: ...@@ -64,6 +64,10 @@ public:
// nop // nop
} }
constexpr intrusive_ptr(std::nullptr_t) noexcept : intrusive_ptr() {
// nop
}
intrusive_ptr(pointer raw_ptr, bool add_ref = true) noexcept { intrusive_ptr(pointer raw_ptr, bool add_ref = true) noexcept {
set_ptr(raw_ptr, add_ref); set_ptr(raw_ptr, add_ref);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment